Ubuntu: domain-name dhcp option not applying to hostname -f



Question:

My Ubuntu 12.04.3 machine is not getting the domain-name option from dhcp applied to the FQDN returned by hostname -f (dnsdomainname returns nothing).

Ip config:

# ip a  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN       link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00      inet 127.0.0.1/8 scope host lo  2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000      link/ether fc:4d:d4:31:89:cb brd ff:ff:ff:ff:ff:ff      inet 10.101.100.166/16 brd 10.101.255.255 scope global eth0  5: vmnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000      link/ether 00:50:56:c0:00:01 brd ff:ff:ff:ff:ff:ff      inet 192.168.185.1/24 brd 192.168.185.255 scope global vmnet1  6: vmnet8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000      link/ether 00:50:56:c0:00:08 brd ff:ff:ff:ff:ff:ff      inet 172.16.10.1/24 brd 172.16.10.255 scope global vmnet8  

tail of dhcp lease:

# tail -16 /var/lib/dhcp/dhclient.eth0.leases   lease {    interface "eth0";    fixed-address 10.101.100.166;    option subnet-mask 255.255.0.0;    option routers 10.101.0.1;    option dhcp-lease-time 14400;    option dhcp-message-type 5;    option domain-name-servers 10.101.200.1,10.101.200.2;    option dhcp-server-identifier 10.101.200.1;    option dhcp-renewal-time 7200;    option dhcp-rebinding-time 12600;    option domain-name "eng.sophos";    renew 4 2013/10/03 14:14:24;    rebind 4 2013/10/03 16:01:08;    expire 4 2013/10/03 16:31:08;  }  

resolv.conf:

# cat /etc/resolv.conf   # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)  #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN  nameserver 10.101.200.1  nameserver 10.101.200.2  search eng.sophos  search eng.sophos green.sophos  

/etc/hosts:

# head /etc/hosts  127.0.0.1       localhost  127.0.1.1       abelard  


Solution:1

As specified in RFC2132, section 3.17, the DHCP domain-name option does not specify the domain name to be assigned to the client. It specifies the domain name that the client should use when resolving hostnames in DNS.

As your /etc/resolv.conf shows, resolvconf accordingly translates the option to a search keyword.

Apart from acting as the default naming context for unqualified hostnames (which can more generically be achieved using the search keyword in resolv.conf), there is no justification for setting the FQDN on a system, as this is a property of the naming system rather than the machine itself.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »