Although the hostname is set: $ cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=d3.dkt It is not set: $ hostname localhost.localdomain $ cat /etc/hosts 127.0.0.1 localhost.localdomain localhost ::1 localhost.localdomain localhost6 localhost6.localdomain6 localhost 10.1.1.111 d3.dkt d3
Do you use NetworkManager or network service ?
Not sure this answers it: $ chkconfig --list | grep etwork NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off network 0:off 1:off 2:off 3:off 4:off 5:off 6:off Didn't touch these.
For me setting HOSTNAME in /etc/sysconfig/network works with NetworkManager.
Another machine showed the same symptoms and I posted a thread at a forum: http://forums.fedoraforum.org/showthread.php?t=258973 The proposed solution worked in both that case and also in this one.
The SELinux message in that other machine: SELinux is preventing /usr/sbin/NetworkManager from unlink access on the file /etc/hosts. Additional Information: Source Context system_u:system_r:NetworkManager_t:s0 Target Context unconfined_u:object_r:etc_t:s0 Target Objects /etc/hosts [ file ] Source NetworkManager Source Path /usr/sbin/NetworkManager Port <Unknown> Host localhost.localdomain Source RPM Packages NetworkManager-0.8.1-10.git20100831.fc13 Target RPM Packages setup-2.8.20-1.fc13 Policy RPM selinux-policy-3.7.19-80.fc13 Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name cl.dkt Platform Linux cl.dkt 2.6.34.7-66.fc13.x86_64 #1 SMP Wed Dec 15 07:04:30 UTC 2010 x86_64 x86_64 Alert Count 24 First Seen Mon 14 Feb 2011 07:01:43 PM BRST Last Seen Tue 15 Feb 2011 12:03:32 PM BRST Local ID 6d5273e2-0cb1-439a-b6c4-131a768295f4 Raw Audit Messages type=AVC msg=audit(1297778612.157:28615): avc: denied { unlink } for pid=1603 comm="NetworkManager" name="hosts" dev=dm-1 ino=1968520 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file type=SYSCALL msg=audit(1297778612.157:28615): arch=x86_64 syscall=rename success=no exit=EACCES a0=1d85e00 a1=48b7b9 a2=1d5a180 a3=1 items=0 ppid=1 pid=1603 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=NetworkManager exe=/usr/sbin/NetworkManager subj=system_u:system_r:NetworkManager_t:s0 key=(null) Hash: NetworkManager,NetworkManager_t,etc_t,file,unlink audit2allow #============= NetworkManager_t ============== allow NetworkManager_t etc_t:file unlink; audit2allow -R #============= NetworkManager_t ============== allow NetworkManager_t etc_t:file unlink;
NM no longer touches /etc/hosts. *** This bug has been marked as a duplicate of bug 648725 ***