LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   "domain-name" and "host-name" options in dhcpd.conf (http://www.linuxquestions.org/questions/linux-server-73/domain-name-and-host-name-options-in-dhcpd-conf-4175428170/)

m4rtin 09-20-2012 04:53 AM

"domain-name" and "host-name" options in dhcpd.conf
 
In dhcpd.conf file one can specify "domain-name" and "host-name":

Code:

host server {
hardware ethernet 00:11:22:33:44:55;
option domain-name "example.net";
option host-name "happyhost";
}

If dhclient requests resources from dhcpd, then "example.net" is written to /etc/resolv.conf file domain and search lines. However, dnsdomainname does not show domain and hostname command or "echo $HOSTNAME" does not show happyhost as an hostname. Could somebody explain this behavior? :rolleyes:

acid_kewpie 09-20-2012 04:59 AM

You'll generally only use the hostname if it's from a DHCP request used to boot from. Coming in this far down the boot up process the hostname will have already been set, and you're not going to just trivially change it now.

m4rtin 09-20-2012 09:13 AM

Quote:

Originally Posted by acid_kewpie (Post 4784891)
You'll generally only use the hostname if it's from a DHCP request used to boot from.

Could you explain this?


In addition, I found from dhcpd.conf man page:

Quote:

Originally Posted by man dhcpd.conf
It should be noted here that most DHCP clients completely ignore the host-name option sent by the DHCP server, and there is no way to configure them not to do this.


acid_kewpie 09-20-2012 09:21 AM

well that is a pretty good explanation.

I mean the only time you'd see this have any effect is if it's a PXE based solution


All times are GMT -5. The time now is 05:18 PM.