Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

[SOLVED] dhclient doesn't set domain-name

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
Whissi
Retired Dev
Retired Dev
User avatar
Posts: 222
Joined: Wed Jan 12, 2011 10:01 pm

[SOLVED] dhclient doesn't set domain-name

  • Quote

Post by Whissi » Wed Jan 12, 2011 10:33 pm

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: Select all

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

Code: Select all

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: Select all

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: Select all

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;
Last edited by Whissi on Thu Jan 13, 2011 8:44 pm, edited 1 time in total.
Regards,
Whissi
Top
tony-curtis
Tux's lil' helper
Tux's lil' helper
Posts: 111
Joined: Sat May 20, 2006 11:52 pm

  • Quote

Post by tony-curtis » Wed Jan 12, 2011 11:37 pm

"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.
Top
Whissi
Retired Dev
Retired Dev
User avatar
Posts: 222
Joined: Wed Jan 12, 2011 10:01 pm

  • Quote

Post by Whissi » Wed Jan 12, 2011 11:53 pm

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: Select all

hostname -f
won't work for example.

You need both. And remember, Debian and Ubuntu will set both values like expected.
Regards,
Whissi
Top
tony-curtis
Tux's lil' helper
Tux's lil' helper
Posts: 111
Joined: Sat May 20, 2006 11:52 pm

  • Quote

Post by tony-curtis » Thu Jan 13, 2011 12:02 am

Oh, well my brain apparently failed today. I've never actually encountered that problem (in over 20 years :o )
Top
Veldrin
Veteran
Veteran
User avatar
Posts: 1945
Joined: Tue Jul 27, 2004 5:47 pm
Location: Zurich, Switzerland

  • Quote

Post by Veldrin » Thu Jan 13, 2011 12:25 am

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.
Top
cwr
Veteran
Veteran
Posts: 1969
Joined: Sat Dec 17, 2005 11:17 am

  • Quote

Post by cwr » Thu Jan 13, 2011 9:13 am

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
Top
Whissi
Retired Dev
Retired Dev
User avatar
Posts: 222
Joined: Wed Jan 12, 2011 10:01 pm

  • Quote

Post by Whissi » Thu Jan 13, 2011 8:43 pm

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
Top
Post Reply

7 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic