View previous topic :: View next topic |
Author |
Message |
venom2099 n00b
Joined: 15 Oct 2009 Posts: 8
|
Posted: Thu Oct 15, 2009 2:56 am Post subject: [solved] dhcpcd will not configure hostname from dhcp/dns |
|
|
I have a host configured eth0 for dhcp using dhcpcd. I get an ip, dns works etc, but the hostname always remains localhost. I can't for the life of me get the dhcp dns name to auto set on the host. This used to work great with dhcpcd 3.2.3, but not with 4 or 5, and 3 is no longer available. Any ideas?
Last edited by venom2099 on Fri Oct 16, 2009 5:06 pm; edited 1 time in total |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Thu Oct 15, 2009 4:44 am Post subject: |
|
|
Trying ??? |
|
Back to top |
|
|
venom2099 n00b
Joined: 15 Oct 2009 Posts: 8
|
Posted: Thu Oct 15, 2009 4:54 pm Post subject: |
|
|
DONAHUE wrote: | Trying ??? |
Code: |
dhcpcd: invalid option -- 'H'
usage: dhcpcd [-dgknpqxyADEGHKLOTV] [-c script] [-f file] [-e var=val]
[-h hostname] [-i classID ] [-l leasetime] [-m metric] [-o option]
[-r ipaddr] [-s ipaddr] [-t timeout] [-u userclass]
[-F none|ptr|both] [-I clientID] [-C hookscript] [-Q option]
[-X ipaddr] <interface>
|
-H is not a valid option even though it appears in the usage, it does not appear in the man page. |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
|
Back to top |
|
|
venom2099 n00b
Joined: 15 Oct 2009 Posts: 8
|
Posted: Thu Oct 15, 2009 5:55 pm Post subject: |
|
|
the dhcpcd man page says this:
Code: |
If the hostname is currently blank, (null) or localhost, or force_hostname is YES or TRUE or 1 then dhcpcd sets the hostname
to the one supplied by the DHCP server. dhcpcd then daemonises and waits for the lease renewal time to lapse. It will then attempt to renew its lease and reconfig-
ure if the new lease changes.
|
so it claims that if force_hostname is YES it will use the dhcp server name.... Where and how does one set this? I have already left the hostname as blank, (null) and localhost and in all cases it stays that way. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
venom2099 n00b
Joined: 15 Oct 2009 Posts: 8
|
Posted: Fri Oct 16, 2009 5:05 pm Post subject: |
|
|
UberLord wrote: | Older dhcpcd versions used to lookup the hostname in DNS if not supplied by the DHCP server.
dhcpcd-5 can still do this, just not by default. There's a setting in /etc/dhcpcd.conf you can comment out to enable it. |
I swear I tried that and it didn't work but perhaps I didn't restart when I thought I did. At any rate this appears to be working. Thanks for the tip. |
|
Back to top |
|
|
anigel Bodhisattva
Joined: 14 Apr 2003 Posts: 1894 Location: Un petit bled pas loin de Limoges ;-)
|
Posted: Sun Sep 11, 2011 3:03 pm Post subject: |
|
|
Hi, same problem here, a few months later.
I just upgraded my workstations to dhcpcd-5.2.12, and setting hostname from DHCP does not work anymore.
My conf is as follows :
Code: | # nohook lookup-hostname
env force_hostname=YES |
It was sufficient a few months ago, but it seems it does not work anymore ? Or maybe I made something wrong... But couldn't find what !
Thanks, _________________ Il y a 10 sortes d'individus en ce bas-monde : ceux qui causent binaire, et les autres. |
|
Back to top |
|
|
anigel Bodhisattva
Joined: 14 Apr 2003 Posts: 1894 Location: Un petit bled pas loin de Limoges ;-)
|
Posted: Thu Aug 30, 2012 1:56 pm Post subject: |
|
|
Hi,
I finally understood what was causing this behaviour.
You can have a look at this bug. _________________ Il y a 10 sortes d'individus en ce bas-monde : ceux qui causent binaire, et les autres. |
|
Back to top |
|
|
|