resolv.conf questions

Tom H tomh0665 at gmail.com
Wed Aug 7 16:18:33 UTC 2019


On Wed, Aug 7, 2019 at 1:58 PM Eliza <eli at chinabuckets.com> 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?

Please bottom post.

Editing "/etc/resolv.conf" isn't going to persist if it's a symlink to
a file under "/run".

What's the output of

ls -l /etc/resolv.conf
ls -l /etc/netplan/*.yaml
cat /etc/netplan/*.yaml

To change the namerserver(s),

For a dynamic ip, use

network:
    version: 2
    renderer: networkd|NetworkManager #### choose one
    ethernets:
        eth0:
            dhcp4: true
            nameservers:
                nameservers: [192.168.0.1, 192.168.0.53] #### use yours

For a static ip, use

network:
    version: 2
    renderer: networkd|NetworkManager #### choose one
    ethernets:
        eth0:
            addresses: [192.168.0.111/24] #### use yours
            gateway4: 192.168.0.1 #### use yours
            nameservers:
                nameservers: [192.168.0.1, 192.168.0.53] #### use yours




More information about the ubuntu-users mailing list