# Some problem with resolv.conf nameserver ordering ipv4+ipv6

## Ridrok

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

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

```
# 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/

```
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

----------

## UberLord

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

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

----------

## Ridrok

Thank you very much.

It works just fine   :Smile: 

----------

