resolv.conf questions

Tom H tomh0665 at gmail.com
Wed Aug 7 16:35:19 UTC 2019


On Wed, Aug 7, 2019 at 2:23 PM Gilles Gravier <ggravier at fsfe.org> wrote:
> On 07/08/2019 13:54, Eliza wrote:
>>
>> Sorry I was still confused.
>> When I put the line into /etc/resolv.conf:
>>
>> nameserver 8.8.8.8
>>
>> after a while it was replaced by the default one:
>>
>> nameserver 127.0.0.53
>>
>> How can I enforce to use 8.8.8.8 as nameserver?
>
> I have the same issue. Here is how I resolved it (beware that if
> you do that, logging into captive portals won't work anymore,
> whereas with 127.0.0.53 it will).
>
> Go to /etc/resolvconf/resolv.conf.d and edit the file head
>
> Add the line(s) nameserver 8.8.8.8 at the end.
>
> While you're at it, add nameserver 8.8.4.4
>
> And any other nameserver line you want (for example cloudflare's
> 1.1.1.1 DNS servers).
>
> If you don't find that directory / file, you might be missing the
> package resolvconf (sudo apt-get install resolvconf)
>
> Then you can edit the above file.
>
> Once this is done, reboot and voila.

?!

1) Editing "/etc/resolv.conf" if it's a symlink to a fule under "/run"
won't persist across reboots.

2) You can't have more than two nameservers in "/etc/resolv.conf".

3) Given that resolvconf is now in the "universe" component, it's
better to use systemd-networkd, which is the "main" component and is
anyway the Ubuntu default.




More information about the ubuntu-users mailing list