I am running OL6.5 on a standalone, not networked machine. The only network connection is internet connection via "Speedport W 921V" ADSL-/VDSL2-Modem (Voice over IP, out of box - no logging to provider's host).
After booting the machine, here is what I have:
[root@localhost ~]# uname -n
localhost.localdoma
[root@localhost ~]# hostname
localhost.localdoma
Notice "localdoma", not "localdomain". Two last characters are trunceted. Now I will explicitly set host name to localhost.localdomain, verify the name, restart the network and verify the host name again.
[root@localhost ~]# hostname localhost.localdomain
[root@localhost ~]# hostname
localhost.localdomain
[root@localhost ~]# uname -n
localhost.localdomain
[root@localhost ~]# /etc/rc.d/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0:
Determining IP information for eth0... done. [ OK ]
[root@localhost ~]# hostname
localhost.localdoma
[root@localhost ~]# uname -n
localhost.localdoma
If network is being started/restarted while NetworkManager daemon is running, the following content of /etc/resolv.conf will be automatically generated by NetworkManager:
[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager
domain Speedport_W_921V_1_34_000
search Speedport_W_921V_1_34_000 localdoma
nameserver 192.168.2.1
If network is being started/restarted while NetworkManager daemon is NOT running, the following content of /etc/resolv.conf will be automatically generated by /sbin/dhclient-script:
[root@localhost ~]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search Speedport_W_921V_1_34_000 localdoma
nameserver 192.168.2.1
This happens regardless of whether DNS bind (named) daemon is running or not, but didn't happen in Oracle Linux 5.x. The /etc/resolv.conf looked similar in 5.x, but without "localdoma" at the end of search line. With the hostname "localhost.localdoma" on IP address 192.168.2.1 Oracle 12c database and grid infrastructure installations will fail, not to mention OEM 12c Grid Control. Therefore I am currently dealing with this problem by putting the line
/bin/hostname localhost.localdomain
at the end of start) in /etc/rc.d/init.d/network startup script. As this is just a workaround, I would like to know where "localdoma" is coming from. Here are the contents of some network related configuration scripts that might be of interest.
[root@localhost ~]# cat /etc/hosts
127.0.0.1 proton.example.com proton localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
10.0.0.1 proton.example.com proton
[root@localhost ~]# getent hosts
127.0.0.1 proton.example.com proton localhost.localdomain localhost
127.0.0.1 localhost6.localdomain6 localhost6
10.0.0.1 proton.example.com proton
Note that proton.example.com is here just because of OEM 12c. Oracle 12c database and grid infrstructure (for ASM) will accept localhost.localdomain on 127.0.0.1, but not OEM 12c. It requires fully qualified host name. And without duplicating the full name and alias in the first and third line, OEM installation will also fail (at retrieving the free ports for installation).
[root@localhost ~]# ping localhost
PING proton.example.com (127.0.0.1) 56(84) bytes of data.
64 bytes from proton.example.com (127.0.0.1): icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from proton.example.com (127.0.0.1): icmp_seq=2 ttl=64 time=0.029 ms
[root@localhost ~]# ping localhost.localdomain
PING proton.example.com (127.0.0.1) 56(84) bytes of data.
64 bytes from proton.example.com (127.0.0.1): icmp_seq=1 ttl=64 time=0.030 ms
64 bytes from proton.example.com (127.0.0.1): icmp_seq=2 ttl=64 time=0.027 ms
[root@localhost ~]# ping proton
PING proton.example.com (127.0.0.1) 56(84) bytes of data.
64 bytes from proton.example.com (127.0.0.1): icmp_seq=1 ttl=64 time=0.031 ms
64 bytes from proton.example.com (127.0.0.1): icmp_seq=2 ttl=64 time=0.024 ms
[root@localhost ~]# ping proton.example.com
PING proton.example.com (127.0.0.1) 56(84) bytes of data.
64 bytes from proton.example.com (127.0.0.1): icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from proton.example.com (127.0.0.1): icmp_seq=2 ttl=64 time=0.023 ms
[root@localhost ~]# ping localhost.localdoma
PING localhost.localdoma (192.168.2.102) 56(84) bytes of data.
64 bytes from localhost.localdoma (192.168.2.102): icmp_seq=1 ttl=64 time=0.031 ms
64 bytes from localhost.localdoma (192.168.2.102): icmp_seq=2 ttl=64 time=0.027 ms
I have two NIC - eth0 and eth1, but only eth0 is configured and active.
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:17:AF:12:54
inet addr:192.168.2.102 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::215:17ff:feaf:1254/64 Scope:Link
inet6 addr: 2003:62:4210:aa30:215:17ff:feaf:1254/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14965 errors:0 dropped:0 overruns:0 frame:0
TX packets:11910 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8843626 (8.4 MiB) TX bytes:2019808 (1.9 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:943 errors:0 dropped:0 overruns:0 frame:0
TX packets:943 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:253185 (247.2 KiB) TX bytes:253185 (247.2 KiB)
[root@localhost ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
NTPSERVERARGS=iburst
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82575EB Gigabit Network Connection
DEVICE=eth0
BOOTPROTO=bootp
HWADDR=00:15:17:AF:12:54
ONBOOT=yes
DHCP_HOSTNAME=localhost.localdomain
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback