# [SOLVED] DHCP does not obtain IP for DNS servers

## v_andal

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

----------

## Syl20

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.

----------

## charles17

 *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?

----------

## v_andal

 *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

```

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?

----------

## charles17

 *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

----------

## v_andal

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

----------

## khayyam

 *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

----------

## v_andal

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

```

 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

```

----------

## khayyam

 *v_andal wrote:*   

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

 

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

----------

## UberLord

 *khayyam wrote:*   

>  *v_andal wrote:*   Maybe there's something strange in my /etc/dhcpcd.conf? It is below
> 
> ```
> interface 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.

----------

## khayyam

 *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

----------

## v_andal

 *khayyam wrote:*   

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

 

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  :Smile: 

----------

