public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Wireless DHCP takes over resolv.conf
@ 2016-07-09 14:53 Mick
  2016-07-09 15:34 ` Fernando Rodriguez
  2016-07-12 22:58 ` [gentoo-user] " Marat BN
  0 siblings, 2 replies; 16+ messages in thread
From: Mick @ 2016-07-09 14:53 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]

Hi All,

I just noticed my resolv.conf is topped up with the nameservers of the 
wireless LAN I happen to be associated at the time and my wired ethernet 
nameserver(s) are pushed further down.  This happens despite the fact that I 
have configured my wired ethernet to have a lesser priority than the wired NIC.

For example:

less /etc/resolv.conf 
# Generated by dhcpcd from wlan0.dhcp, enp11s0.dhcp
# /etc/resolv.conf.head can replace this line
domain openwifi
nameserver 192.168.22.22
nameserver 192.168.22.23
nameserver 10.10.10.254
# /etc/resolv.conf.tail can replace this line

The first 3 non-commented entries were produced by wlan0, demoting my wired 
ethernet nameserver.

ip route show
default via 10.10.10.254 dev enp11s0  metric 10 
default via 10.160.95.1 dev wlan0  metric 20 
10.10.10.0/24 dev enp11s0  proto kernel  scope link  src 10.10.10.7  metric 10 
10.160.95.0/29 dev wlan0  proto kernel  scope link  src 10.160.95.2  metric 20 
127.0.0.0/8 dev lo  scope host 

If I am associated, but not authenticated with the wireless LAN, any URLs I 
try to visit will be queried with the 192.168.22.2* nameserver, before it 
times out and 10.10.10.254 takes over.

Waiting for URLs to resolve becomes tedious after a while.  Is there a way to 
prioritise nameservers so that the NIC metric is respected, whenever the 
resolv.conf content is updated?

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Wireless DHCP takes over resolv.conf
  2016-07-09 14:53 [gentoo-user] Wireless DHCP takes over resolv.conf Mick
@ 2016-07-09 15:34 ` Fernando Rodriguez
  2016-07-09 19:25   ` Mick
  2016-07-12 22:58 ` [gentoo-user] " Marat BN
  1 sibling, 1 reply; 16+ messages in thread
From: Fernando Rodriguez @ 2016-07-09 15:34 UTC (permalink / raw
  To: gentoo-user

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 07/09/2016 10:53 AM, Mick wrote:
> Hi All,
> 
> I just noticed my resolv.conf is topped up with the nameservers of the 
> wireless LAN I happen to be associated at the time and my wired ethernet 
> nameserver(s) are pushed further down.  This happens despite the fact that I 
> have configured my wired ethernet to have a lesser priority than the wired NIC.
> 
> For example:
> 
> less /etc/resolv.conf 
> # Generated by dhcpcd from wlan0.dhcp, enp11s0.dhcp
> # /etc/resolv.conf.head can replace this lineL
> domain openwifi
> nameserver 192.168.22.22
> nameserver 192.168.22.23
> nameserver 10.10.10.254
> # /etc/resolv.conf.tail can replace this line
> 
> The first 3 non-commented entries were produced by wlan0, demoting my wired 
> ethernet nameserver.
> 
> ip route show
> default via 10.10.10.254 dev enp11s0  metric 10 
> default via 10.160.95.1 dev wlan0  metric 20 
> 10.10.10.0/24 dev enp11s0  proto kernel  scope link  src 10.10.10.7  metric 10 
> 10.160.95.0/29 dev wlan0  proto kernel  scope link  src 10.160.95.2  metric 20 
> 127.0.0.0/8 dev lo  scope host 
> 
> If I am associated, but not authenticated with the wireless LAN, any URLs I 
> try to visit will be queried with the 192.168.22.2* nameserver, before it 
> times out and 10.10.10.254 takes over.
> 
> Waiting for URLs to resolve becomes tedious after a while.  Is there a way to 
> prioritise nameservers so that the NIC metric is respected, whenever the 
> resolv.conf content is updated?
> 

Look at the -C option on dhcpcd's man page. It is done by a dhcpcd hook that you
can disable with that option. Where to specify it depends on what you're using to
manage your network connections.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXgRmiAAoJEPbOFX/5UlwckloP/RS5QM9FrJN/EGk5F2v3vakC
DP5EIqx103d2Qte91zmBPNGpq3PKCDi2aQza3dIspQ6zfR/I4P8u3ODbsclIc1U9
gikAKos+fVB+6nVCAVKKrpyWsDGJ7Qgupu+x1SOP1MDLNBkDnIgS2n72S0Z6FCUF
d5q4lUyp5w8G/+A+m01FnpFZCcBZBfBLQY9cccUR6CkkuJW1+vjPzppJoeQ032CT
FRqebV17htnJzuME85KcVTuawiO8xuHM/Y9tkVupe8fyEPlG8k53WY4XNh3KuuEZ
gIqjsYJWEJeH0HQp9MFM+HBesJrRAgaTT0jAmEXiNcKeVx0UHZppNfSl8q/NKT+o
rChcHJ62lrW8Q4gHtf7I5tkXyZdfLM1TdiViLTKUR9EGkV+lnoQFHDbe0+MCirkC
/2XsbYTUBWb5zMwCH0I9QCjA8LsCD5I4YK+strXld+6+yaGRDNh2XUo36uJCoJNZ
6fbOweDHCV9CMgkHH78swYZa3Fu7z8n4my7i/lEo9L+7r0IIcspDrxhgtP4T7qLu
UYrWoOTALUwiyqtIry7FnciifdlrCoURm9rAp9jZAz8PTha33d2Vhlj/tKiL8v3x
YmuB+Tz9/yLp8VXpR5h2hO4i2WTOQnW+vgugw0v3DJqE3JRKqqGsfhX9gA4JTDz2
Jwp9Faoag1hKEf8Dl8I9
=TqPa
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Wireless DHCP takes over resolv.conf
  2016-07-09 15:34 ` Fernando Rodriguez
@ 2016-07-09 19:25   ` Mick
  2016-07-09 19:53     ` Fernando Rodriguez
  0 siblings, 1 reply; 16+ messages in thread
From: Mick @ 2016-07-09 19:25 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 2079 bytes --]

On Saturday 09 Jul 2016 11:34:59 Fernando Rodriguez wrote:
> On 07/09/2016 10:53 AM, Mick wrote:
> > Hi All,
> > 
> > I just noticed my resolv.conf is topped up with the nameservers of the
> > wireless LAN I happen to be associated at the time and my wired ethernet
> > nameserver(s) are pushed further down.  This happens despite the fact that
> > I have configured my wired ethernet to have a lesser priority than the
> > wired NIC.
> > 
> > For example:
> > 
> > less /etc/resolv.conf
> > # Generated by dhcpcd from wlan0.dhcp, enp11s0.dhcp
> > # /etc/resolv.conf.head can replace this lineL
> > domain openwifi
> > nameserver 192.168.22.22
> > nameserver 192.168.22.23
> > nameserver 10.10.10.254
> > # /etc/resolv.conf.tail can replace this line
> > 
> > The first 3 non-commented entries were produced by wlan0, demoting my
> > wired
> > ethernet nameserver.
> > 
> > ip route show
> > default via 10.10.10.254 dev enp11s0  metric 10
> > default via 10.160.95.1 dev wlan0  metric 20
> > 10.10.10.0/24 dev enp11s0  proto kernel  scope link  src 10.10.10.7 
> > metric 10 10.160.95.0/29 dev wlan0  proto kernel  scope link  src
> > 10.160.95.2  metric 20 127.0.0.0/8 dev lo  scope host
> > 
> > If I am associated, but not authenticated with the wireless LAN, any URLs
> > I
> > try to visit will be queried with the 192.168.22.2* nameserver, before it
> > times out and 10.10.10.254 takes over.
> > 
> > Waiting for URLs to resolve becomes tedious after a while.  Is there a way
> > to prioritise nameservers so that the NIC metric is respected, whenever
> > the resolv.conf content is updated?
> 
> Look at the -C option on dhcpcd's man page. It is done by a dhcpcd hook that
> you can disable with that option. Where to specify it depends on what
> you're using to manage your network connections.

Thanks, that'll work, but it is a nuclear option because, as I understand it, 
it will work all the time.  So when the ethernet cable is disconnected the 
wireless will not be able to obtain nameservers.

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Wireless DHCP takes over resolv.conf
  2016-07-09 19:25   ` Mick
@ 2016-07-09 19:53     ` Fernando Rodriguez
  2016-07-11  8:32       ` Emanuele Rusconi
  0 siblings, 1 reply; 16+ messages in thread
From: Fernando Rodriguez @ 2016-07-09 19:53 UTC (permalink / raw
  To: gentoo-user

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

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

Check out net-dns/openresolv [1]. I've never used it but it's mean to solve that problem.
If you use NetworkManager I think all you need to do is enable that use flag.

[1] http://roy.marples.name/projects/openresolv/index

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXgVYtAAoJEPbOFX/5Ulwc0MIP/RcyQ6dAed9YAC9KOMwCrfmu
SsONlWAaBgCSrHKGZcI3a4G9WKd8kyGPUM2deSP02JBNTDiHwZxwb494dQk2u2HN
Y6WoHE65F7LE6er5HaPBW28qTSHQ0BaH2SNQzJsId+hl0CnVfFr8t6IU+Qav7W2m
Oyeh3Wph5kDHx2cX80Czs45lWkxIbcsx2bN8a4G9ZjSk23KDtkvG5F5CgZgU/aYK
F0815O0lqzA+CLhSgzQsYOeF5aRBQ1jEh+EHSWC6Py6AuSNHmw5YanrnpelzFNHD
GhG26b2aKuXcUI7DW2MtF3vnMqcQ8nXIZjpkoKF0JAy31ruPvKJVCWMuVUrZD/l1
uTqo1DhfUyaynjG2cX5TZ9+pk8GfAaRG+W9bq/xu/v4zAKxfVZS8DUo2VOMvZqdv
YO8azzbwqyPfG7M6mF6NPLBR4h+EQYpCHoh8B8u+gsXkRxsDB5zlKqaXGO579p15
tvaAxbpW6veDH8taQITEnG7cGLm+cv9raVYmBK2rcOvPSnbfYE/A+UifmQ9gBNp7
CzEpEryIuUIL+ztkgQpLxZY1ldAt3WuiB99i+rcksVvsOO3mSHq10298M+PcfM0g
tvCkL6ttDhPiTQCXvzHuaH8lvxfHdN70LUrKngnC2NtQpzXdgFcSJynJ26wx6xrU
P6Txb5Q7nzPO+bdF7otO
=2Z4B
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Wireless DHCP takes over resolv.conf
  2016-07-09 19:53     ` Fernando Rodriguez
@ 2016-07-11  8:32       ` Emanuele Rusconi
  2016-07-11 15:31         ` Alan McKinnon
  0 siblings, 1 reply; 16+ messages in thread
From: Emanuele Rusconi @ 2016-07-11  8:32 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 611 bytes --]

Wouldn't it be better to just use the same servers for both wired and
wireless? It's what I use and it works flawlessly.
In that case you have at least a couple of options:

The second line says:

    # /etc/resolv.conf.head can replace this line

So, you can just put your preferred servers in the /etc/resolv.conf.head
file and they will be written at the top of /etc/resolv.conf .


Or, you can write your own /etc/resolv.conf and add this line to your
/etc/dhcpcd.conf :

    nohook resolv.conf

This is the same as the -C option, and tells dhcpcd to not overwrite
/etc/resolv.conf .



-- Emanuele Rusconi

[-- Attachment #2: Type: text/html, Size: 972 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Wireless DHCP takes over resolv.conf
  2016-07-11  8:32       ` Emanuele Rusconi
@ 2016-07-11 15:31         ` Alan McKinnon
  2016-07-11 18:13           ` Mick
  2016-07-12 21:18           ` [gentoo-user] " Emanuele Rusconi
  0 siblings, 2 replies; 16+ messages in thread
From: Alan McKinnon @ 2016-07-11 15:31 UTC (permalink / raw
  To: gentoo-user

On 11/07/2016 10:32, Emanuele Rusconi wrote:
> Wouldn't it be better to just use the same servers for both wired and
> wireless? It's what I use and it works flawlessly.

It works flawlessly *for you*, but by no means can you consider it
correct or stable.

There is no guarantee that a wired and wireless network will use the
same dns caches.

If it happens to work, great, use it. But be aware there will come a day
when that is no longer true.




-- 
Alan McKinnon
alan.mckinnon@gmail.com



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Wireless DHCP takes over resolv.conf
  2016-07-11 15:31         ` Alan McKinnon
@ 2016-07-11 18:13           ` Mick
  2016-07-11 20:07             ` Alan McKinnon
  2016-07-12 21:18           ` [gentoo-user] " Emanuele Rusconi
  1 sibling, 1 reply; 16+ messages in thread
From: Mick @ 2016-07-11 18:13 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 804 bytes --]

On Monday 11 Jul 2016 17:31:29 Alan McKinnon wrote:
> On 11/07/2016 10:32, Emanuele Rusconi wrote:
> > Wouldn't it be better to just use the same servers for both wired and
> > wireless? It's what I use and it works flawlessly.
> 
> It works flawlessly *for you*, but by no means can you consider it
> correct or stable.
> 
> There is no guarantee that a wired and wireless network will use the
> same dns caches.

Yep, furthermore this is a laptop which is taken around the place and plugged 
in and out of wired and wireless networks.


> If it happens to work, great, use it. But be aware there will come a day
> when that is no longer true.

When I get a minute I'll have a look at net-dns/openresolv which Fernando 
suggested.  I think it will do what want.

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Wireless DHCP takes over resolv.conf
  2016-07-11 18:13           ` Mick
@ 2016-07-11 20:07             ` Alan McKinnon
  2016-07-11 20:29               ` [gentoo-user] " Grant Edwards
  0 siblings, 1 reply; 16+ messages in thread
From: Alan McKinnon @ 2016-07-11 20:07 UTC (permalink / raw
  To: gentoo-user

On 11/07/2016 20:13, Mick wrote:
> On Monday 11 Jul 2016 17:31:29 Alan McKinnon wrote:
>> On 11/07/2016 10:32, Emanuele Rusconi wrote:
>>> Wouldn't it be better to just use the same servers for both wired and
>>> wireless? It's what I use and it works flawlessly.
>>
>> It works flawlessly *for you*, but by no means can you consider it
>> correct or stable.
>>
>> There is no guarantee that a wired and wireless network will use the
>> same dns caches.
>
> Yep, furthermore this is a laptop which is taken around the place and plugged
> in and out of wired and wireless networks.
>
>
>> If it happens to work, great, use it. But be aware there will come a day
>> when that is no longer true.
>
> When I get a minute I'll have a look at net-dns/openresolv which Fernando
> suggested.  I think it will do what want.
>

why don't you go with the dns server addresses supplied by each 
network's dhcp? Presumably the admin put them their because they work on 
that network.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [gentoo-user] Re: Wireless DHCP takes over resolv.conf
  2016-07-11 20:07             ` Alan McKinnon
@ 2016-07-11 20:29               ` Grant Edwards
  2016-07-11 20:34                 ` Alan McKinnon
  0 siblings, 1 reply; 16+ messages in thread
From: Grant Edwards @ 2016-07-11 20:29 UTC (permalink / raw
  To: gentoo-user

On 2016-07-11, Alan McKinnon <alan.mckinnon@gmail.com> wrote:

> why don't you go with the dns server addresses supplied by each
> network's dhcp? Presumably the admin put them their because they
> work on that network.

One might think that, but I find it often not to be the case.  I can
recall many networks where the DNS servers returned by the DHCP server
didn't work well at all, and things got a _lot_ better when I manually
configured a couple working DNS servers (e.g. the Google ones at
8.8.8.8 and 8.8.4.4).  Around here, Comcast's DNS servers are famously
bad.

-- 
Grant Edwards               grant.b.edwards        Yow! Hey, waiter!  I want
                                  at               a NEW SHIRT and a PONY TAIL
                              gmail.com            with lemon sauce!



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Re: Wireless DHCP takes over resolv.conf
  2016-07-11 20:29               ` [gentoo-user] " Grant Edwards
@ 2016-07-11 20:34                 ` Alan McKinnon
  2016-07-11 21:03                   ` Grant Edwards
  0 siblings, 1 reply; 16+ messages in thread
From: Alan McKinnon @ 2016-07-11 20:34 UTC (permalink / raw
  To: gentoo-user

On 11/07/2016 22:29, Grant Edwards wrote:
> On 2016-07-11, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
>
>> why don't you go with the dns server addresses supplied by each
>> network's dhcp? Presumably the admin put them their because they
>> work on that network.
>
> One might think that, but I find it often not to be the case.  I can
> recall many networks where the DNS servers returned by the DHCP server
> didn't work well at all, and things got a _lot_ better when I manually
> configured a couple working DNS servers (e.g. the Google ones at
> 8.8.8.8 and 8.8.4.4).  Around here, Comcast's DNS servers are famously
> bad.
>

Then shoot the idiot running that wireless network. If he's one of my 
juniors, tell me so I can fire him (as he's just proved he can't do the 
job he's paid to do)


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [gentoo-user] Re: Wireless DHCP takes over resolv.conf
  2016-07-11 20:34                 ` Alan McKinnon
@ 2016-07-11 21:03                   ` Grant Edwards
  2016-07-11 21:50                     ` Alan McKinnon
  0 siblings, 1 reply; 16+ messages in thread
From: Grant Edwards @ 2016-07-11 21:03 UTC (permalink / raw
  To: gentoo-user

On 2016-07-11, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> On 11/07/2016 22:29, Grant Edwards wrote:
>> On 2016-07-11, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
>>
>>> why don't you go with the dns server addresses supplied by each
>>> network's dhcp? Presumably the admin put them their because they
>>> work on that network.
>>
>> One might think that, but I find it often not to be the case.  I can
>> recall many networks where the DNS servers returned by the DHCP server
>> didn't work well at all, and things got a _lot_ better when I manually
>> configured a couple working DNS servers (e.g. the Google ones at
>> 8.8.8.8 and 8.8.4.4).  Around here, Comcast's DNS servers are famously
>> bad.

> Then shoot the idiot running that wireless network.

You're not actually allowed to do that General Dreedle...

> If he's one of my juniors, tell me so I can fire him (as he's just
> proved he can't do the job he's paid to do)

And if you're at a customer or vendor site?  A friend's or relative's
house?  Using a municiple WiFi system?  Using WiFi on an airplane,
bus, train, whatever?

Sometimes you just need to get along with people and get some work
done.  You always can't demand that things get done your way or
somebody's gonna get fired or taken out back and beaten...

-- 
Grant Edwards               grant.b.edwards        Yow! ... I think I'd
                                  at               better go back to my DESK
                              gmail.com            and toy with a few common
                                                   MISAPPREHENSIONS ...



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Re: Wireless DHCP takes over resolv.conf
  2016-07-11 21:03                   ` Grant Edwards
@ 2016-07-11 21:50                     ` Alan McKinnon
  2016-07-11 22:32                       ` Mick
  0 siblings, 1 reply; 16+ messages in thread
From: Alan McKinnon @ 2016-07-11 21:50 UTC (permalink / raw
  To: gentoo-user

On 11/07/2016 23:03, Grant Edwards wrote:
> On 2016-07-11, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
>> On 11/07/2016 22:29, Grant Edwards wrote:
>>> On 2016-07-11, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
>>>
>>>> why don't you go with the dns server addresses supplied by each
>>>> network's dhcp? Presumably the admin put them their because they
>>>> work on that network.
>>>
>>> One might think that, but I find it often not to be the case.  I can
>>> recall many networks where the DNS servers returned by the DHCP server
>>> didn't work well at all, and things got a _lot_ better when I manually
>>> configured a couple working DNS servers (e.g. the Google ones at
>>> 8.8.8.8 and 8.8.4.4).  Around here, Comcast's DNS servers are famously
>>> bad.
>
>> Then shoot the idiot running that wireless network.
>
> You're not actually allowed to do that General Dreedle...
>
>> If he's one of my juniors, tell me so I can fire him (as he's just
>> proved he can't do the job he's paid to do)
>
> And if you're at a customer or vendor site?  A friend's or relative's
> house?  Using a municiple WiFi system?  Using WiFi on an airplane,
> bus, train, whatever?
>
> Sometimes you just need to get along with people and get some work
> done.  You always can't demand that things get done your way or
> somebody's gonna get fired or taken out back and beaten...
>

Pretty much always worked for me. I'm one of the guys that sets things 
up so that guys like you have no reason to ever say "Around here, 
Comcast's DNS servers are famously bad". Replace "Comcast" with the real 
name of my real employer. If my team gets that wrong (and we never have 
thus far), millions of people immediately and at once suffer. So forgive 
me if I'm a tad touchy on the subject.

But seriously, if the dns servers provided by dhcp aren't up to snuff 
then by all means put working ones in your resolv.conf. And also help 
the owner of the network fix his config - there really is no excuse for 
setting up software to tell people to use broken or badly behaved caches.

Alan


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Re: Wireless DHCP takes over resolv.conf
  2016-07-11 21:50                     ` Alan McKinnon
@ 2016-07-11 22:32                       ` Mick
  0 siblings, 0 replies; 16+ messages in thread
From: Mick @ 2016-07-11 22:32 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 3221 bytes --]

On Monday 11 Jul 2016 23:50:48 Alan McKinnon wrote:
> On 11/07/2016 23:03, Grant Edwards wrote:
> > On 2016-07-11, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> >> On 11/07/2016 22:29, Grant Edwards wrote:
> >>> On 2016-07-11, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> >>>> why don't you go with the dns server addresses supplied by each
> >>>> network's dhcp? Presumably the admin put them their because they
> >>>> work on that network.
> >>> 
> >>> One might think that, but I find it often not to be the case.  I can
> >>> recall many networks where the DNS servers returned by the DHCP server
> >>> didn't work well at all, and things got a _lot_ better when I manually
> >>> configured a couple working DNS servers (e.g. the Google ones at
> >>> 8.8.8.8 and 8.8.4.4).  Around here, Comcast's DNS servers are famously
> >>> bad.
> >> 
> >> Then shoot the idiot running that wireless network.
> > 
> > You're not actually allowed to do that General Dreedle...
> > 
> >> If he's one of my juniors, tell me so I can fire him (as he's just
> >> proved he can't do the job he's paid to do)
> > 
> > And if you're at a customer or vendor site?  A friend's or relative's
> > house?  Using a municiple WiFi system?  Using WiFi on an airplane,
> > bus, train, whatever?
> > 
> > Sometimes you just need to get along with people and get some work
> > done.  You always can't demand that things get done your way or
> > somebody's gonna get fired or taken out back and beaten...
> 
> Pretty much always worked for me. I'm one of the guys that sets things
> up so that guys like you have no reason to ever say "Around here,
> Comcast's DNS servers are famously bad". Replace "Comcast" with the real
> name of my real employer. If my team gets that wrong (and we never have
> thus far), millions of people immediately and at once suffer. So forgive
> me if I'm a tad touchy on the subject.
> 
> But seriously, if the dns servers provided by dhcp aren't up to snuff
> then by all means put working ones in your resolv.conf. And also help
> the owner of the network fix his config - there really is no excuse for
> setting up software to tell people to use broken or badly behaved caches.
> 
> Alan

All good points made here and Alan's style of leadership (...daily floggings 
will continue until morale improves) surely works in some cases.  However, in 
certain locations there are 2 or 3 open WiFi networks which I may accidentally 
associate with.  They will not let you use their network without 
registering/login in with them, using your browser.  So, when I end up 
associating with any of them, their nameservers pollute my resolv.conf and 
delays ensue every time I seek a URL.  Sometimes the WiFi network is one I 
want to associate with, but not use its relatively slower nameservers, until I 
unplug the ethernet cable and roam around the office.  There are more nuanced 
use cases (some network servers are not accessible via WiFi, but are via 
ethernet) but I don't want to complicate further the basic requirement:

It would be great if the order of nameservers entered in /etc/resolv.conf 
respected the metric of the NIC.

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Wireless DHCP takes over resolv.conf
  2016-07-11 15:31         ` Alan McKinnon
  2016-07-11 18:13           ` Mick
@ 2016-07-12 21:18           ` Emanuele Rusconi
  2016-07-12 22:36             ` [gentoo-user] " Grant Edwards
  1 sibling, 1 reply; 16+ messages in thread
From: Emanuele Rusconi @ 2016-07-12 21:18 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

On 11 July 2016 at 17:31, Alan McKinnon <alan.mckinnon@gmail.com> wrote:

> On 11/07/2016 10:32, Emanuele Rusconi wrote:
> > Wouldn't it be better to just use the same servers for both wired and
> > wireless? It's what I use and it works flawlessly.
>
> It works flawlessly *for you*, but by no means can you consider it
> correct or stable.
>
> There is no guarantee that a wired and wireless network will use the
> same dns caches.
>
> If it happens to work, great, use it. But be aware there will come a day
> when that is no longer true.


That's why I phrased my suggestion as a question. I'm honestly curious:
aren't DNS servers like Google ones (8.8.8.8 etc.) supposed to be reachable
from anywhere? If you can't reach them, isn't your connectivity inherently
broken? I'm sure I'm missing something here.

-- Emanuele Rusconi

[-- Attachment #2: Type: text/html, Size: 1342 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [gentoo-user] Re: Wireless DHCP takes over resolv.conf
  2016-07-12 21:18           ` [gentoo-user] " Emanuele Rusconi
@ 2016-07-12 22:36             ` Grant Edwards
  0 siblings, 0 replies; 16+ messages in thread
From: Grant Edwards @ 2016-07-12 22:36 UTC (permalink / raw
  To: gentoo-user

On 2016-07-12, Emanuele Rusconi <emarsk@gmail.com> wrote:

> That's why I phrased my suggestion as a question. I'm honestly curious:
> aren't DNS servers like Google ones (8.8.8.8 etc.) supposed to be reachable
> from anywhere? If you can't reach them, isn't your connectivity inherently
> broken? I'm sure I'm missing something here.

Oh, I'm sure there's some brain-dead ISP or BofH somewhere who blocks
traffic to outside DNS servers.  Inevitably it's done in the name of
security.

Even if 8.8.8.8 is reachable, there may be internal, locally defined
hostnames that Google won't know about.

That said, after problems with various DNS servers on various
networks, I usually default to using 8.8.8.8...

-- 
Grant Edwards               grant.b.edwards        Yow! Does someone from
                                  at               PEORIA have a SHORTER
                              gmail.com            ATTENTION span than me?



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] Wireless DHCP takes over resolv.conf
  2016-07-09 14:53 [gentoo-user] Wireless DHCP takes over resolv.conf Mick
  2016-07-09 15:34 ` Fernando Rodriguez
@ 2016-07-12 22:58 ` Marat BN
  1 sibling, 0 replies; 16+ messages in thread
From: Marat BN @ 2016-07-12 22:58 UTC (permalink / raw
  To: gentoo-user

The solution I use when dealing with the problem of network software
overwriting '/etc/resolf.conf' is to make that file immutable with
'chattr +i'.

Not quite an answer to your question on nameserver prioritization, but
could be useful to prevent your nameservers from being changed.


-- Marat



On 07/09/2016 07:53 AM, Mick wrote:
> Hi All,
>
> I just noticed my resolv.conf is topped up with the nameservers of the 
> wireless LAN I happen to be associated at the time and my wired ethernet 
> nameserver(s) are pushed further down.  This happens despite the fact that I 
> have configured my wired ethernet to have a lesser priority than the wired NIC.
>
> For example:
>
> less /etc/resolv.conf 
> # Generated by dhcpcd from wlan0.dhcp, enp11s0.dhcp
> # /etc/resolv.conf.head can replace this line
> domain openwifi
> nameserver 192.168.22.22
> nameserver 192.168.22.23
> nameserver 10.10.10.254
> # /etc/resolv.conf.tail can replace this line
>
> The first 3 non-commented entries were produced by wlan0, demoting my wired 
> ethernet nameserver.
>
> ip route show
> default via 10.10.10.254 dev enp11s0  metric 10 
> default via 10.160.95.1 dev wlan0  metric 20 
> 10.10.10.0/24 dev enp11s0  proto kernel  scope link  src 10.10.10.7  metric 10 
> 10.160.95.0/29 dev wlan0  proto kernel  scope link  src 10.160.95.2  metric 20 
> 127.0.0.0/8 dev lo  scope host 
>
> If I am associated, but not authenticated with the wireless LAN, any URLs I 
> try to visit will be queried with the 192.168.22.2* nameserver, before it 
> times out and 10.10.10.254 takes over.
>
> Waiting for URLs to resolve becomes tedious after a while.  Is there a way to 
> prioritise nameservers so that the NIC metric is respected, whenever the 
> resolv.conf content is updated?
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-07-12 22:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-09 14:53 [gentoo-user] Wireless DHCP takes over resolv.conf Mick
2016-07-09 15:34 ` Fernando Rodriguez
2016-07-09 19:25   ` Mick
2016-07-09 19:53     ` Fernando Rodriguez
2016-07-11  8:32       ` Emanuele Rusconi
2016-07-11 15:31         ` Alan McKinnon
2016-07-11 18:13           ` Mick
2016-07-11 20:07             ` Alan McKinnon
2016-07-11 20:29               ` [gentoo-user] " Grant Edwards
2016-07-11 20:34                 ` Alan McKinnon
2016-07-11 21:03                   ` Grant Edwards
2016-07-11 21:50                     ` Alan McKinnon
2016-07-11 22:32                       ` Mick
2016-07-12 21:18           ` [gentoo-user] " Emanuele Rusconi
2016-07-12 22:36             ` [gentoo-user] " Grant Edwards
2016-07-12 22:58 ` [gentoo-user] " Marat BN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox