Description of problem: ifup sets a hostname for eth interfaces and the user has no control of it. Version-Release number of selected component (if applicable): initscripts-8.45.17.EL-1 How reproducible: Have a eth interface connected to the internet and set it up with a static IP address. Have a PTR record for this IP address. Make sure your domain name is one of 'localhost' or 'localhost.localdomain' and start the interface. Steps to Reproduce: 1. ifup eth0 Actual results: Your hostname changes to the value in the PTR record Expected results: Well, it should change, but we need some control over it, because for some reason a user would like it to stay localhost.localdomain or just localhost. I suggest adding a NEED_HOSTNAME value in each interface configured. In case it's NEED_CONFIG=no, we won't calculate a new hostname for it. I'm suggesting a patch to resolve that issue for the file /etc/sysconfig/network-scripts/network-functions. The patch is in front of Additional info: On ppp and plip interfates this does not happen (witness it in /etc/sysconfig/network-scripts/ifup-post).
Created attachment 265101 [details] Patch to network-functions to enable the NEED_HOSTNAME flag
Why would you want to keep a localhost hostname?
My case is configuring a computer with certain settings. Then later connecting it to the Internet and suddenly getting a new hostname. Some applications / settings which depended on it failed to run. I believe that this unexpected / surprising hostname change is somewhat problematic. Besides, the suggested patch does not interfere with any other behavior which is currently implemented.
This is expected behavior in pretty much every release since the old Red Hat Linux days - if a static hostname is expected, just setting it to something other than localhost should do the trick.
Expected behavior is preserved but more flexibility is added. I would like to keep a localhost.localdomain hostname regardless of what's happening. It's not that awkward.