1

I know there're several post about this and have gone through all of them, but can't really understand how to solve it.

Problem I'm connected to my network but not to the internet. If you do a ping you get this

ping: www.google.com: Name or service not known

Try this answer and not working: DNS_PROBE_FINISHED_BAD_CONFIG error in Ubuntu 14.04

/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf`
sudo rm /etc/resolv.conf
sudo ln -s ../run/resolvconf/resolv.conf /etc/resolv.conf
sudo resolvconf -u

Try using sudo dpkg-reconfigure resolvconf and getting this error

resolvconf-pull-resolved.service is a disabled or a static unit, not starting it.
resolvconf-pull-resolved.service is a disabled or a static unit, not starting it.

The only possible solution I found is this one, but I think is a temporary answer: https://askubuntu.com/a/46036/83345

Have to edit the /etc/resolv.conf and add manually the DNS

sudo nano /etc/resolv.conf

But I'm afraid the changes will overwritten after the reboot

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 208.67.222.222
nameserver 208.67.220.220
nameserver 8.8.8.8

So the question will be, how do I add these DNS permanently, if I reboot this changes will get lost?

Content of /etc/netplan/*.yaml

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
#I add these manually, base in one of the answers but
#getting this error
#sudo netplan apply --debug -Error in network definition: unknown key #'nameservers'nameservers:

nameservers:
  [8.8.8.8, 208.67.222.222,208.67.220.220]

/etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

/etc/resolv.conf

# Generated by Connection Manager
nameserver ::1
nameserver 127.0.0.1
Diego
  • 591
  • This is a server, yes? Your /etc/resolv.conf doesn't show the local DNS server. Edit your question and show me cat /etc/netplan/*.yaml and cat /etc/network/interfaces and cat /etc/resolv.conf. – heynnema Jun 06 '19 at 16:06

1 Answers1

0

If you have Ubuntu >= 18.04 then, yes, they will get lost eventually because they get overwritten. Jack Wallen explains this in his article, and how you should possibly configure your DNS.

If you have Ubuntu < 18.04 then you can manually edit some of your other settings using /etc/network/interfaces

Recap:

18.04

Basically start by modifying your network config files now located at: /etc/netplan/<<01-99>>-netcfg.yaml. You'll want to make the appropriate edits to the .yaml file like so:

...
nameservers:
    [8.8.8.8, 8.8.4.4]
...

then type: sudo netplan apply or sudo netplan apply --debug if something goes wrong.

< 18.04

edit: /etc/network/interfaces like so:

...
dns-addresses 8.8.4.4,8.8.8.8
...

Penguino
  • 116
  • I supposed that this location: /etc/netplan/<<01-99>>-netcfg.yaml will be /etc/netplan/01-network-manager-all.yaml in my case? – Diego Jun 06 '19 at 15:15
  • Try it with the debug flag and getting this error /etc/netplan/01-network-manager-all.yaml:5:1: Error in network definition: unknown key 'nameservers' nameservers: – Diego Jun 06 '19 at 15:21
  • This might help: https://askubuntu.com/questions/961552/need-example-netplan-yaml-for-static-ip. You can also use netplan --debug generate to help you discover syntax errors. – Penguino Jun 11 '19 at 16:39
  • This is what I get sudo netplan --debug apply ** (generate:15050): DEBUG: 19:41:57.807: Processing input file /etc/netplan/01-network-manager-all.yaml.. ** (generate:15050): DEBUG: 19:41:57.807: starting new processing pass /etc/netplan/01-network-manager-all.yaml:6:1: Error in network definition: unknown key 'nameservers' nameservers: ^ – Diego Jun 28 '19 at 01:42