DHCP Server
Hi,
I'm running DHCP Server on my CentOS 4.4 system. I have two clients workstations both CentOS 4.4. I want to be able to give the two client machines hostnames. But as they obtain there IP Address from the DHCP Server i cannot create them, For example: vi /etc/hosts 127.0.0.1 localhost localdomain XXX.XXX.XXX.XXX client.xxxxx.com How can i give my client workstation a hostname if the IP address changes? It's probably really simple, go easy im new at this stuff. Thanks for any help Rich |
Quote:
That way they will not change (unless you change them) and your /etc/hosts files will be correct. |
I would accomplish what you are looking for by editing /etc/dhclient.conf.
I would remove the comments from these lines: Code:
#request subnet-mask, broadcast-address, time-offset, routers, Peace, JimBass |
I'm creating a router for a small network "University Project", so assigning a static IP address for the client is not a problem. I would like to be able to give the client the option to change the hostname. But it does make sense to remove the comments from the lines in /etc/dhclient.conf. As in the real world static IP addresses would be used for a dhcp server.
The only other way to do it would be to assigne static IP addressess from the dhcp server then change them from the server end. |
The DHCP server can assign the same address to a MAC address, or it can allow the address to come from the pool of allowed addresses. If you configure the DHCP server to give out hostnames, then it will.
I don't understand your recent post. In the first post you say you want to assign hostnames, then in the second you say you want the client to be able to change hostnames? Either the hostname is set on the machine, or it accepts a hostname from DHCP. Much like an IP address, it either is set by the client machine or the server, but not both. I also don't understand what you mean by, "in the real world static IP addresses would be used for a dhcp server." A DHCP server can assign real world IP addresses or LAN addresses. And they can be fixed per client or part of a pool. I think we might be using different names for things. Reading the output of Code:
man dhcpd.conf Peace, JimBass |
All times are GMT -5. The time now is 08:26 PM. |