Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] dhcpcd will not configure hostname from dhcp/dns
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
venom2099
n00b
n00b


Joined: 15 Oct 2009
Posts: 8

PostPosted: Thu Oct 15, 2009 2:56 am    Post subject: [solved] dhcpcd will not configure hostname from dhcp/dns Reply with quote

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
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Thu Oct 15, 2009 4:44 am    Post subject: Reply with quote

Trying
Code:
dhcpcd -HD eth0
???
Back to top
View user's profile Send private message
venom2099
n00b
n00b


Joined: 15 Oct 2009
Posts: 8

PostPosted: Thu Oct 15, 2009 4:54 pm    Post subject: Reply with quote

DONAHUE wrote:
Trying
Code:
dhcpcd -HD eth0
???



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
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Thu Oct 15, 2009 5:11 pm    Post subject: Reply with quote

I saw that. Apparently dhcpcd gave up on using the server to provide a hostname. dhclient does not either according to http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=3#doc_chap3 . nor does pump per its man page.
Back to top
View user's profile Send private message
venom2099
n00b
n00b


Joined: 15 Oct 2009
Posts: 8

PostPosted: Thu Oct 15, 2009 5:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Oct 16, 2009 10:44 am    Post subject: Reply with quote

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.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
venom2099
n00b
n00b


Joined: 15 Oct 2009
Posts: 8

PostPosted: Fri Oct 16, 2009 5:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
anigel
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 1894
Location: Un petit bled pas loin de Limoges ;-)

PostPosted: Sun Sep 11, 2011 3:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
anigel
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 1894
Location: Un petit bled pas loin de Limoges ;-)

PostPosted: Thu Aug 30, 2012 1:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum