Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Some problem with resolv.conf nameserver ordering ipv4+ipv6
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
Ridrok
n00b
n00b


Joined: 26 Jan 2014
Posts: 2
Location: France

PostPosted: Sun Jan 26, 2014 3:35 pm    Post subject: Some problem with resolv.conf nameserver ordering ipv4+ipv6 Reply with quote

Hello,

I have a small problem on my Gentoo desktop.
My network setup is very very simple: I have a single network card which is eth0 and I get my IP addresses using dhcpcd.

So /etc/conf.d/net is
Code:
dns_domain_lo="mydomain.local"
config_eth0="dhcp"

My Internet provider provides me with IPv4 and IPv6 connectivity and my router (a Gentoo too) use DNSMasq to provide IPv4 DHCP, IPV6 RA and DNS information using DHCPv6 for Windows hosts.

The problem I have on my gentoo desktop is the DNS order in /etc/resolv.conf. It always put the IPv4 DNS before the IPv6 one and I want to use the IPv6 one by default.

The Generated /etc/resolv.conf is:
Code:
# Generated by dhcpcd from eth0, eth0:dhcp6, eth0:ra
# /etc/resolv.conf.head can replace this line
domain mydomain.local
nameserver 192.168.10.254
nameserver 2a03:x:y:z::1
# /etc/resolv.conf.tail can replace this line

(I did protect my IPv6 address by changing real values by "x:y:z")

As fas as I understood dhcpcd generates and uses the files in /run/dhcpcd/resolv.conf/
Code:
Vangogh ~ # ll /run/dhcpcd/resolv.conf/
total 12K
-rw-r--r-- 1 root root 81 26 janv. 15:21 eth0
-rw-r--r-- 1 root root 89 26 janv. 15:22 eth0:dhcp6
-rw-r--r-- 1 root root 86 26 janv. 15:41 eth0:ra


Can someone point me to a solution? How can I make dhcpcd to use the RA or DHCPv6 DNS information before using the IPv4 one so that the resolv.conf has 2a03:x:y:z::1 listed before 192.168.10.254?

Many thanks,
Ridrok
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6336
Location: Blighty

PostPosted: Mon Jan 27, 2014 11:47 am    Post subject: Reply with quote

Install openresolv and set this in /etc/resolvconf.conf

Code:
interface_order="lo lo[0-9]* eth0:dhcp6 eth0:ra"

_________________
When baselayout tells you to update config files or things break WE REALLY DO MEAN IT

Please add SOLVED to the thread title if your issue has been
Strip comments from configs please
Back to top
View user's profile Send private message
Ridrok
n00b
n00b


Joined: 26 Jan 2014
Posts: 2
Location: France

PostPosted: Mon Jan 27, 2014 2:51 pm    Post subject: Reply with quote

Thank you very much.

It works just fine :)
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