# [solved] why does dhcpcd adds a nameserver to resolv.conf ?

## toralf

I do have in /etc/dhcpcd.conf:

```
nooption domain_name_servers, domain_name, domain_search, host_name

```

but still gets 

```
t# cat /etc/resolv.conf

# Generated by dhcpcd from wlp3s0.dhcp6

# =start of /etc/resolv.conf.head

nameserver 127.0.0.1

# =end of/etc/resolv.conf.head

nameserver fd00::a96:d7ff:fe05:f928

# =start of /etc/resolv.conf.tail

search localdomain kvm_domain

# =end of /etc/resolv.conf.tail

```

Last edited by toralf on Wed Sep 20, 2017 12:13 pm; edited 1 time in total

----------

## Maxxx

Reading dhcpcd.conf man, i think that i would try 

```
nohook resolv.conf
```

in your /etc/dhcpcd.conf.

----------

## toralf

 *Maxxx wrote:*   

> Reading dhcpcd.conf man, i think that i would try 
> 
> ```
> nohook resolv.conf
> ```
> ...

 Well, I need sometimes the domain from DHCP, furthermore resolv.conf.{head,tail} should be used to construct resolv.conf.

----------

## UberLord

Lets dump our leases (I'm not excluding anything in dhcpcd.conf for this example)

```
$ dhcpcd -U iwi0 2>/dev/null | grep name

domain_name='marples.name fo.bar'

domain_name_servers=10.73.2.1

domain_search=marples.name

host_name=uberlaptop

server_name=gw.marples.name

dhcp6_domain_search=marples.name

dhcp6_name_servers=fd73:7808:1015::1

```

Aha! So the DHCP6 option has a different name!

so this should work

```
nooption dhcp6_name_servers
```

Lets see ... we can test this on the command line with existing leases.

```
p$ dhcpcd -U iwi0 --nooption dhcp6_name_servers --nooption domain_name_servers 2>/dev/null | grep name

domain_name='marples.name fo.bar'

domain_search=marples.name

host_name=uberlaptop

server_name=gw.marples.name

dhcp6_domain_search=marples.name

```

Yup, works fine!

All this is documented in the fine man pages .... you can even get a dump of all known variables/options using dhcpcd -V (this is also documented)

Can you suggest documentation improvements?

----------

## krinn

 *UberLord wrote:*   

> Can you suggest documentation improvements?

 

pm UberLord in gentoo forum as man1?  :Very Happy: 

----------

## toralf

 *UberLord wrote:*   

> All this is documented in the fine man pages .... you can even get a dump of all known variables/options using dhcpcd -V (this is also documented)
> 
> Can you suggest documentation improvements?

 Ough, maybe a big fat red blinking line like "+ + + Toralf, RTFM  ! + + + " maybe ?  :Smile: 

Beside that a hint in /etc/dhcpcd.conf would be nice.

----------

## Ant P.

Probably not worth the effort to fix this, but I should point out "fd00::" on its own isn't standards-compliant - the 10 hex digits following the fd are supposed to be randomised:

```
perl -wE 'open(my $fh,"<","/dev/urandom");read($fh, my $buf, 5);say join ":",unpack("(H4)*","\xfd$buf")'
```

----------

## UberLord

 *Ant P. wrote:*   

> Probably not worth the effort to fix this, but I should point out "fd00::" on its own isn't standards-compliant - the 10 hex digits following the fd are supposed to be randomised:
> 
> ```
> perl -wE 'open(my $fh,"<","/dev/urandom");read($fh, my $buf, 5);say join ":",unpack("(H4)*","\xfd$buf")'
> ```
> ...

 

Nothing above has fd00:: on it's own above? What are you seeing?

Besides, each instance just reports an address to send to, not one we should assign to an interface ourselves.

----------

