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


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 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 brd 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 brd 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 brd scope global vmnet8  

tail of dhcp lease:

# tail -16 /var/lib/dhcp/dhclient.eth0.leases   lease {    interface "eth0";    fixed-address;    option subnet-mask;    option routers;    option dhcp-lease-time 14400;    option dhcp-message-type 5;    option domain-name-servers,;    option dhcp-server-identifier;    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;  }  


# 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  nameserver  search eng.sophos  search eng.sophos green.sophos  


# head /etc/hosts       localhost       abelard  


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
Next Post »