Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] dhclient doesn't set domain-name
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
Whissi
Developer
Developer


Joined: 12 Jan 2011
Posts: 157

PostPosted: Wed Jan 12, 2011 10:33 pm    Post subject: [SOLVED] dhclient doesn't set domain-name Reply with quote

Hi,

I have network with an own domain name (intern.example.org for example).
A Debian system is running a dhcpd (isc-dhcpd-4.1.1-P1) and a DNSd.

Everything is working fine:
Other clients (Windows, Debian and Ubunt systems) will get the network configuration by the DHCP. Every client will set the domain-name option for example correctly.

Now I added my first Gentoo system to my network. It's running dhclient (isc-dhclient-V3.1.2p1-Gentoo).

The problem is, that dhclient does not set the domain. For example, after dhclient received the configuration from the dhcpd, my "/etc/resolv.conf" looks like

Code:
gentoo ~ # cat /etc/resolv.conf
# Generated by dhclient for interface eth0
search intern.example.org
nameserver 192.168.1.2


but I expected

Code:
domain intern.example.org
search intern.example.org
nameserver 192.168.1.2


I captured the DHCP request and ACK, I can see that dhclient is requesting the domain-name as configured, and also receiving the domain-name... but it isn't set.

Here are some configuration files:
Code:
gentoo ~ # cat /etc/conf.d/net
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

config_eth0=( "dhcp" )
module_eth0=( "dhclient" )


Code:
gentoo ~ # cat /etc/dhcp/dhclient.conf
send host-name "gentoo";
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, domain-search, host-name,
        netbios-name-servers, netbios-scope, interface-mtu,
        ntp-servers;

_________________
Regards,
Whissi


Last edited by Whissi on Thu Jan 13, 2011 8:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
tony-curtis
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2006
Posts: 111

PostPosted: Wed Jan 12, 2011 11:37 pm    Post subject: Reply with quote

"search" does the same thing as "domain" here, however search lets you list out multiple names, whereas domain is just a single value.

There's a man page for resolv.conf(5) that shows how this process works.
Back to top
View user's profile Send private message
Whissi
Developer
Developer


Joined: 12 Jan 2011
Posts: 157

PostPosted: Wed Jan 12, 2011 11:53 pm    Post subject: Reply with quote

tony-curtis wrote:
"search" does the same thing as "domain" here, however search lets you list out multiple names, whereas domain is just a single value.

There's a man page for resolv.conf(5) that shows how this process works.

No, it doesn't the same thing here: Without "domain",
Code:
hostname -f

won't work for example.

You need both. And remember, Debian and Ubuntu will set both values like expected.
_________________
Regards,
Whissi
Back to top
View user's profile Send private message
tony-curtis
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2006
Posts: 111

PostPosted: Thu Jan 13, 2011 12:02 am    Post subject: Reply with quote

Oh, well my brain apparently failed today. I've never actually encountered that problem (in over 20 years :o )
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Thu Jan 13, 2011 12:25 am    Post subject: Reply with quote

check if you have your hostname (without domainname) listed in /etc/hosts.

If you remove it, hostname -f should work again.

cheers
V.
_________________
read the portage output!
If my answer is too concise, ask for an explanation.
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Thu Jan 13, 2011 9:13 am    Post subject: Reply with quote

I've had a similar problem with a missing local domain name, where the answer was to use eg:
xxx.xxx.xxx.xxx localhost.localdomain localhost
and not
xxx.xxx.xxx.xxx localhost localdomain.localdomain
in /etc/hosts.

I can't imagine why this would make a difference, but apparently it does. It might work
for DHCP as well.

Will
Back to top
View user's profile Send private message
Whissi
Developer
Developer


Joined: 12 Jan 2011
Posts: 157

PostPosted: Thu Jan 13, 2011 8:43 pm    Post subject: Reply with quote

Hi,
Veldrin wrote:
check if you have your hostname (without domainname) listed in /etc/hosts.

If you remove it, hostname -f should work again.

Yes, the hostname without the domain-name was listed in the hosts file.
I removed it and hostname -f is now working as expected.

Thank you!
_________________
Regards,
Whissi
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