1 |
On Saturday 09 Jul 2016 11:34:59 Fernando Rodriguez wrote: |
2 |
> On 07/09/2016 10:53 AM, Mick wrote: |
3 |
> > Hi All, |
4 |
> > |
5 |
> > I just noticed my resolv.conf is topped up with the nameservers of the |
6 |
> > wireless LAN I happen to be associated at the time and my wired ethernet |
7 |
> > nameserver(s) are pushed further down. This happens despite the fact that |
8 |
> > I have configured my wired ethernet to have a lesser priority than the |
9 |
> > wired NIC. |
10 |
> > |
11 |
> > For example: |
12 |
> > |
13 |
> > less /etc/resolv.conf |
14 |
> > # Generated by dhcpcd from wlan0.dhcp, enp11s0.dhcp |
15 |
> > # /etc/resolv.conf.head can replace this lineL |
16 |
> > domain openwifi |
17 |
> > nameserver 192.168.22.22 |
18 |
> > nameserver 192.168.22.23 |
19 |
> > nameserver 10.10.10.254 |
20 |
> > # /etc/resolv.conf.tail can replace this line |
21 |
> > |
22 |
> > The first 3 non-commented entries were produced by wlan0, demoting my |
23 |
> > wired |
24 |
> > ethernet nameserver. |
25 |
> > |
26 |
> > ip route show |
27 |
> > default via 10.10.10.254 dev enp11s0 metric 10 |
28 |
> > default via 10.160.95.1 dev wlan0 metric 20 |
29 |
> > 10.10.10.0/24 dev enp11s0 proto kernel scope link src 10.10.10.7 |
30 |
> > metric 10 10.160.95.0/29 dev wlan0 proto kernel scope link src |
31 |
> > 10.160.95.2 metric 20 127.0.0.0/8 dev lo scope host |
32 |
> > |
33 |
> > If I am associated, but not authenticated with the wireless LAN, any URLs |
34 |
> > I |
35 |
> > try to visit will be queried with the 192.168.22.2* nameserver, before it |
36 |
> > times out and 10.10.10.254 takes over. |
37 |
> > |
38 |
> > Waiting for URLs to resolve becomes tedious after a while. Is there a way |
39 |
> > to prioritise nameservers so that the NIC metric is respected, whenever |
40 |
> > the resolv.conf content is updated? |
41 |
> |
42 |
> Look at the -C option on dhcpcd's man page. It is done by a dhcpcd hook that |
43 |
> you can disable with that option. Where to specify it depends on what |
44 |
> you're using to manage your network connections. |
45 |
|
46 |
Thanks, that'll work, but it is a nuclear option because, as I understand it, |
47 |
it will work all the time. So when the ethernet cable is disconnected the |
48 |
wireless will not be able to obtain nameservers. |
49 |
|
50 |
-- |
51 |
Regards, |
52 |
Mick |