1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA256 |
3 |
|
4 |
On 07/09/2016 03:25 PM, Mick wrote: |
5 |
> On Saturday 09 Jul 2016 11:34:59 Fernando Rodriguez wrote: |
6 |
>> On 07/09/2016 10:53 AM, Mick wrote: |
7 |
>>> Hi All, |
8 |
>>> |
9 |
>>> I just noticed my resolv.conf is topped up with the nameservers of the |
10 |
>>> wireless LAN I happen to be associated at the time and my wired ethernet |
11 |
>>> nameserver(s) are pushed further down. This happens despite the fact that |
12 |
>>> I have configured my wired ethernet to have a lesser priority than the |
13 |
>>> wired NIC. |
14 |
>>> |
15 |
>>> For example: |
16 |
>>> |
17 |
>>> less /etc/resolv.conf |
18 |
>>> # Generated by dhcpcd from wlan0.dhcp, enp11s0.dhcp |
19 |
>>> # /etc/resolv.conf.head can replace this lineL |
20 |
>>> domain openwifi |
21 |
>>> nameserver 192.168.22.22 |
22 |
>>> nameserver 192.168.22.23 |
23 |
>>> nameserver 10.10.10.254 |
24 |
>>> # /etc/resolv.conf.tail can replace this line |
25 |
>>> |
26 |
>>> The first 3 non-commented entries were produced by wlan0, demoting my |
27 |
>>> wired |
28 |
>>> ethernet nameserver. |
29 |
>>> |
30 |
>>> ip route show |
31 |
>>> default via 10.10.10.254 dev enp11s0 metric 10 |
32 |
>>> default via 10.160.95.1 dev wlan0 metric 20 |
33 |
>>> 10.10.10.0/24 dev enp11s0 proto kernel scope link src 10.10.10.7 |
34 |
>>> metric 10 10.160.95.0/29 dev wlan0 proto kernel scope link src |
35 |
>>> 10.160.95.2 metric 20 127.0.0.0/8 dev lo scope host |
36 |
>>> |
37 |
>>> If I am associated, but not authenticated with the wireless LAN, any URLs |
38 |
>>> I |
39 |
>>> try to visit will be queried with the 192.168.22.2* nameserver, before it |
40 |
>>> times out and 10.10.10.254 takes over. |
41 |
>>> |
42 |
>>> Waiting for URLs to resolve becomes tedious after a while. Is there a way |
43 |
>>> to prioritise nameservers so that the NIC metric is respected, whenever |
44 |
>>> the resolv.conf content is updated? |
45 |
>> |
46 |
>> Look at the -C option on dhcpcd's man page. It is done by a dhcpcd hook that |
47 |
>> you can disable with that option. Where to specify it depends on what |
48 |
>> you're using to manage your network connections. |
49 |
> |
50 |
> Thanks, that'll work, but it is a nuclear option because, as I understand it, |
51 |
> it will work all the time. So when the ethernet cable is disconnected the |
52 |
> wireless will not be able to obtain nameservers. |
53 |
|
54 |
Check out net-dns/openresolv [1]. I've never used it but it's mean to solve that problem. |
55 |
If you use NetworkManager I think all you need to do is enable that use flag. |
56 |
|
57 |
[1] http://roy.marples.name/projects/openresolv/index |
58 |
|
59 |
-----BEGIN PGP SIGNATURE----- |
60 |
Version: GnuPG v2 |
61 |
|
62 |
iQIcBAEBCAAGBQJXgVYtAAoJEPbOFX/5Ulwc0MIP/RcyQ6dAed9YAC9KOMwCrfmu |
63 |
SsONlWAaBgCSrHKGZcI3a4G9WKd8kyGPUM2deSP02JBNTDiHwZxwb494dQk2u2HN |
64 |
Y6WoHE65F7LE6er5HaPBW28qTSHQ0BaH2SNQzJsId+hl0CnVfFr8t6IU+Qav7W2m |
65 |
Oyeh3Wph5kDHx2cX80Czs45lWkxIbcsx2bN8a4G9ZjSk23KDtkvG5F5CgZgU/aYK |
66 |
F0815O0lqzA+CLhSgzQsYOeF5aRBQ1jEh+EHSWC6Py6AuSNHmw5YanrnpelzFNHD |
67 |
GhG26b2aKuXcUI7DW2MtF3vnMqcQ8nXIZjpkoKF0JAy31ruPvKJVCWMuVUrZD/l1 |
68 |
uTqo1DhfUyaynjG2cX5TZ9+pk8GfAaRG+W9bq/xu/v4zAKxfVZS8DUo2VOMvZqdv |
69 |
YO8azzbwqyPfG7M6mF6NPLBR4h+EQYpCHoh8B8u+gsXkRxsDB5zlKqaXGO579p15 |
70 |
tvaAxbpW6veDH8taQITEnG7cGLm+cv9raVYmBK2rcOvPSnbfYE/A+UifmQ9gBNp7 |
71 |
CzEpEryIuUIL+ztkgQpLxZY1ldAt3WuiB99i+rcksVvsOO3mSHq10298M+PcfM0g |
72 |
tvCkL6ttDhPiTQCXvzHuaH8lvxfHdN70LUrKngnC2NtQpzXdgFcSJynJ26wx6xrU |
73 |
P6Txb5Q7nzPO+bdF7otO |
74 |
=2Z4B |
75 |
-----END PGP SIGNATURE----- |