Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] DHCP does not obtain IP for DNS servers
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
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 521
Location: Germany

PostPosted: Fri Apr 08, 2016 10:41 am    Post subject: [SOLVED] DHCP does not obtain IP for DNS servers Reply with quote

Couple days ago my router (Fritz!Box 7490) got firmware update, since then my Gentoo Linux computer does not create correct /etc/resolv.conf. DHCP daemon writes there only domain name (fritz.box) but does not put any IP addresses for DNS servers. Windows computers and Android devices work fine. How could I debug (and hopefully solve) this issue? Well, for now I've disabled DNS updating and put IPs of Google DNS in /etc/resolv.conf but still I'm really curious, what could go wrong with DHCP?

Last edited by v_andal on Mon Apr 11, 2016 4:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
Syl20
Guru
Guru


Joined: 04 Aug 2005
Posts: 550
Location: France

PostPosted: Fri Apr 08, 2016 10:52 am    Post subject: Reply with quote

Could you post the contents of your /etc/conf.d/net file (if you use OpenRC) please ? There are several available DHCP clients, and each has its own options.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2583

PostPosted: Fri Apr 08, 2016 12:10 pm    Post subject: Re: DHCP does not obtain IP for DNS servers Reply with quote

v_andal wrote:
Couple days ago my router (Fritz!Box 7490) got firmware update, since then my Gentoo Linux computer does not create correct /etc/resolv.conf. DHCP daemon writes there only domain name (fritz.box) but does not put any IP addresses for DNS servers. Windows computers and Android devices work fine. How could I debug (and hopefully solve) this issue? Well, for now I've disabled DNS updating and put IPs of Google DNS in /etc/resolv.conf but still I'm really curious, what could go wrong with DHCP?

Did you check http://fritz.box/?lp=wSet for your Gentoo device? Is there an IP address assigned?
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 521
Location: Germany

PostPosted: Sat Apr 09, 2016 9:36 am    Post subject: Reply with quote

Syl20 wrote:
Could you post the contents of your /etc/conf.d/net file (if you use OpenRC) please ? There are several available DHCP clients, and each has its own options.


Nothing special in conf.d/net file
Code:

modules_wlp9s0="wpa_supplicant"
config_wlp9s0="dhcp"
config_enp7s0="dhcp"


I'm using net-misc/dhcpcd version 6.10.1

The IP addresses are assigned without any problem, only the DNS servers are not written in /etc/resolv.conf

Are there any debugging flags for dhcpcd? How would I configure them and where would I find the logs?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2583

PostPosted: Sat Apr 09, 2016 1:01 pm    Post subject: Reply with quote

v_andal wrote:
Are there any debugging flags for dhcpcd? How would I configure them and where would I find the logs?

See https://wiki.gentoo.org/wiki/Network_management_using_DHCPCD#Testing
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 521
Location: Germany

PostPosted: Sun Apr 10, 2016 9:40 am    Post subject: Reply with quote

I've tried to run dhcpcd manually and captured its output. I've also captured the traffic using Wireshark. It appears, that my dhcpcd does not request DNS servers name from the server. In the "Parameter Request List" section the option "Domain Name Server" is missing.

Now comes the question, why doesn't dhcpcd request it?

Just in case, the output for dhcpcd -db can be found here. The wireshark trace here . To compare, here is the trace for "normal" dhcp
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Apr 10, 2016 10:06 am    Post subject: Reply with quote

v_andal wrote:
Now comes the question, why doesn't dhcpcd request it?

v_andal ... that is triggered by the '20-resolv.conf' hook, this should be automatically enabled as if you don't want resolv.conf configured you have to pass '-C resolv.conf' (to disable the hook). Assuming you've added nothing to /etc/dhcpcd.conf then this may be a bug in 6.10.1 ... try the stable package 6.10.0.

best ... khay
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 521
Location: Germany

PostPosted: Sun Apr 10, 2016 2:24 pm    Post subject: Reply with quote

Hm, I've downgraded to 6.10.0, it didn't help. It's a mystery, it was working until the update of DSL Router.

Maybe there's something strange in my /etc/dhcpcd.conf? It is below

Code:

 interface lo
static ip_address=127.0.0.1/8

hostname

duid

persistent

option rapid_commit

option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
option interface_mtu

require dhcp_server_identifier

slaac private

nohook lookup-hostname
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Apr 10, 2016 2:42 pm    Post subject: Reply with quote

v_andal wrote:
Maybe there's something strange in my /etc/dhcpcd.conf? It is below

Code:
interface lo
static ip_address=127.0.0.1/8

v_andal ... that may be the cause as 'interface' effects subsequent options, and so everything defined is for 'lo'. You don't need to have dhcpcd manage 'lo' as net.lo is doing this.

best ... khay
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Mon Apr 11, 2016 10:03 am    Post subject: Reply with quote

khayyam wrote:
v_andal wrote:
Maybe there's something strange in my /etc/dhcpcd.conf? It is below

Code:
interface lo
static ip_address=127.0.0.1/8

v_andal ... that may be the cause as 'interface' effects subsequent options, and so everything defined is for 'lo'.


Good spot, that's exactly the problem.

Quote:
You don't need to have dhcpcd manage 'lo' as net.lo is doing this.


Also true, but OP might not want to use net.* from the netifrc package.
Still init.d/network that ships with OpenRC can also handle the loopback interface.
_________________
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
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Mon Apr 11, 2016 11:55 am    Post subject: Reply with quote

UberLord wrote:
khayyam wrote:
You don't need to have dhcpcd manage 'lo' as net.lo is doing this.

Also true, but OP might not want to use net.* from the netifrc package. Still init.d/network that ships with OpenRC can also handle the loopback interface.

UberLord ... they posted their /etc/conf.d/net, so I would assume netifrc is in use.

best ... khay
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 521
Location: Germany

PostPosted: Mon Apr 11, 2016 4:06 pm    Post subject: Reply with quote

khayyam wrote:
v_andal wrote:
Maybe there's something strange in my /etc/dhcpcd.conf? It is below

Code:
interface lo
static ip_address=127.0.0.1/8

v_andal ... that may be the cause as 'interface' effects subsequent options, and so everything defined is for 'lo'. You don't need to have dhcpcd manage 'lo' as net.lo is doing this.

best ... khay


You are right. Removing those 2 lines fixed the issue. Funny, I have them there since the time when I tried to manage network with dhcpcd only last year. It didn't work out quite well then, so I've reverted to using "standard" way, but the lines stayed. They didn't cause any problems until few days ago :)
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