[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DHCP and hostname



Getting a static IP address is not feasible.  Also to get the DHCP server
to return the right hostname might not be feasible.

Will it be feasible to get the hostname from the DNS once the IP address
has been assigned (either when I boot the machine up or when the lease for
the address is renewed) and run the "hostname" command automatically so
that the correct hostname is in effect?  I do it now manually by logging
in as root (use "ifconfig" to get the IP address and "host" for the name).

Thanks
Venkat

On Fri, 24 Jul 1998, Troy Hanson wrote:

> The simplest way is to get a static address assigned (outside of the DHCP
> pool).  And have a static DNS entry for that address.
> 
> The second way is to have the DHCP Administrator add a static-mapping for
> your ethernet card address, so you always get the same IP (whether your
> lease expired or not).  Also, have a static DNS entry for that reserved lease.
> 
> As far as your question about asking the DNS for your IP,  you can't query
> a name server until you have an IP address, which puts you in a catch-22
> situation.  In addition, the DHCP server + DNS would need to have dynamic
> DNS ability (to keep the DHCP addresses associated with the names).  WINS
> does this, but only for NetBIOS/NetBEUI names, not hostnames.
> 
> In theory, you could get a random IP, find out what name is assoiciated
> with that IP, and have a script go through every file that contains your
> hostname, change that hostname, and restart all the affected daemons. :)
> 
> later,
> troy
> 
> At 12:35 PM 7/24/98 -0400, you wrote:
> >My linux machine is in a network where the IP addresses are assigned 
> >using DHCP.  I use "dhcpcd" to get the IP address but it also mangles 
> >my machine's hostname (probably because the DHCP server is not properly
> >configured).  Is there a way to query the DNS server for the correct
> >hostname from the assigned IP address and assign it?  Can this be
> >automated?  Thanks.
> >
> >Venkat
> >
> >
> >--  
> >Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org <
> /dev/null
> > 
> 




--  
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


Reply to: