From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 637FD1382FE for ; Sat, 9 Jul 2016 19:52:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3C2E3E0BE8; Sat, 9 Jul 2016 19:52:23 +0000 (UTC) Received: from mail-vk0-f67.google.com (mail-vk0-f67.google.com [209.85.213.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 20E0CE0BE1 for ; Sat, 9 Jul 2016 19:52:22 +0000 (UTC) Received: by mail-vk0-f67.google.com with SMTP id v6so12819621vkb.1 for ; Sat, 09 Jul 2016 12:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=zyVe7arqzQwnntV8EqrG6Y5sYRgRUlgzNNMDn9jixCw=; b=zH8MO+41C4ACeQZaKb9EQUr7bggRUbVPPmTvHl6GWsC7MqleFMeIHXp8NvFWSEFjb8 HoZ3k9UKw7l/dl2zh4OM6L/S1N++ZzYvt5s3CdPdkiM18dGsLy3fzxRoPIMcg59HRD9X 6j8pMCtN2qFbqLNo9YeBQlkmImfypOllGFq6HB6yNFDAZDFgEGIwvlGWDlhBLOBOewlW Bm5iEvQOk4BxTlrbloUoKbfC2wn8UOYeYSjb+Ui09d9LNjmetp8qF/0totaJYDCZLU0E uq/1mQCQ7+5OLJpIAj9NKPorWBa8eJP+YUmysi0+XHOFT2yvwT+3wkeLFP0jHR1ix02P bSBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=zyVe7arqzQwnntV8EqrG6Y5sYRgRUlgzNNMDn9jixCw=; b=azrbeI7/4Cr5ML4ni121NrtxIy58hPBk+o4K+aWAKDiSrvEDU3hfchuH1K48UF1tg8 o/dVb+crLgYGuPONQZxVumcyGa+9yvTAN6HTe6EypMp1E3dtIhhJ5qeroR6eoYpS7Dtp yWhB3a0IdIxRO46A5vq8t6y1iWlv+QzNgSMg37huCAQaVn7pIqBtP3stgyYh2JDS2EIW 018eZBC8e8vhWOmxHM9+Xdhros3lSQ3IO7l+GH2q5vCxvZopxryXB8QSsT9x5JrCrOcH QXyRllQoJeiEjtfj0BC7EZbc0Qfw5SouSIBSjowFVNT4Y60/YdwFeUK2o2GsiFaQgM0K fSOA== X-Gm-Message-State: ALyK8tKFSSDMnKenMt3134K/LPIVYXaYbIm5ihU/7RbZx8FCagOyHx/cIFj7ACk9zXJXxw== X-Received: by 10.31.232.67 with SMTP id f64mr4811703vkh.44.1468093941063; Sat, 09 Jul 2016 12:52:21 -0700 (PDT) Received: from [10.10.0.10] (97-102-36-170.res.bhn.net. [97.102.36.170]) by smtp.gmail.com with ESMTPSA id 10sm689136ual.12.2016.07.09.12.52.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jul 2016 12:52:20 -0700 (PDT) Subject: Re: [gentoo-user] Wireless DHCP takes over resolv.conf To: gentoo-user@lists.gentoo.org References: <1659782.mMxfcyeGIg@dell_xps> <0d999f80-f3b5-a853-289e-ff0ea830c292@gmail.com> <6677826.UpoQaKC3Hd@dell_xps> From: Fernando Rodriguez Message-ID: Date: Sat, 9 Jul 2016 15:53:18 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <6677826.UpoQaKC3Hd@dell_xps> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: fede6a20-c94c-47ef-8562-5aaa0933e0dc X-Archives-Hash: 3def28e84159119e14d789676ceb969d -----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-----