Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] why does dhcpcd adds a nameserver to resolv.conf ?
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
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3648
Location: Hamburg

PostPosted: Tue Sep 19, 2017 1:49 pm    Post subject: [solved] why does dhcpcd adds a nameserver to resolv.conf ? Reply with quote

I do have in /etc/dhcpcd.conf:
Code:
nooption domain_name_servers, domain_name, domain_search, host_name
but still gets
Code:
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
Back to top
View user's profile Send private message
Maxxx
Guru
Guru


Joined: 12 Jan 2016
Posts: 515
Location: Italia

PostPosted: Tue Sep 19, 2017 5:02 pm    Post subject: Reply with quote

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

Code:
nohook resolv.conf


in your /etc/dhcpcd.conf.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3648
Location: Hamburg

PostPosted: Tue Sep 19, 2017 6:45 pm    Post subject: Reply with quote

Maxxx wrote:
Reading dhcpcd.conf man, i think that i would try

Code:
nohook resolv.conf


in your /etc/dhcpcd.conf.
Well, I need sometimes the domain from DHCP, furthermore resolv.conf.{head,tail} should be used to construct resolv.conf.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Sep 20, 2017 11:19 am    Post subject: Reply with quote

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

Code:
$ 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

Code:
nooption dhcp6_name_servers


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

Code:
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?
_________________
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
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6968

PostPosted: Wed Sep 20, 2017 11:35 am    Post subject: Reply with quote

UberLord wrote:
Can you suggest documentation improvements?

pm UberLord in gentoo forum as man1? :D
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3648
Location: Hamburg

PostPosted: Wed Sep 20, 2017 12:13 pm    Post subject: Reply with quote

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 ? :-)
Beside that a hint in /etc/dhcpcd.conf would be nice.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5593

PostPosted: Wed Sep 20, 2017 4:44 pm    Post subject: Reply with quote

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:
Code:
perl -wE 'open(my $fh,"<","/dev/urandom");read($fh, my $buf, 5);say join ":",unpack("(H4)*","\xfd$buf")'
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Sep 20, 2017 5:20 pm    Post subject: Reply with quote

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:
Code:
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.
_________________
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
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