1

I changed my dns settings as shown by the website https://1.1.1.1/

The changes did not work I just want to get on 1.1.1.1 lol

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • "changes did not work" Well, how did you test that ? Also, what's your Ubuntu version ? Ubuntu 18.04 uses a bit different configuration than say 16.04 – Sergiy Kolodyazhnyy Feb 11 '19 at 03:04
  • lol there's a blocked site that becomes unblocked when I enable 1.1.1.1 on my windows pc.. https://ibb.co/NCy0vxK I'm on 18.04 – Craig Nelson Feb 11 '19 at 03:08
  • I tried deleting the space after the comma, no difference – Craig Nelson Feb 11 '19 at 03:17
  • OK, try either systemd-resolve --set-dns=1.1.1.1 in terminal or editing config file as shown in https://askubuntu.com/a/1024720/295286 Also try systemd-resolve --set-dns=1.1.1.1 && systemctl restart systemd-resolved (that is set DNS and then restart the service which we're configuring) If that doesn't work you'd have to wait for someone to post an answer using netplan which is the network manager in 18.04, however I don't have experience with netplan so cannot suggest how to best edit its config files – Sergiy Kolodyazhnyy Feb 11 '19 at 03:40
  • Didn't work, just to be clear, this is the response I'm supposed to get in the terminal, right?: https://ibb.co/Tvt244p – Craig Nelson Feb 11 '19 at 04:09
  • Nevermind, it seems to have worked after a restart - although, is there a way to add the backup server of 1.0.0.1 and the ipv6 servers, (606:4700:4700::1111 - primary, and 2606:4700:4700::1001 - backup) – Craig Nelson Feb 11 '19 at 04:19

1 Answers1

2

As resolved ( no pun intended ) in the comments, setting DNS on 18.04 can be done by configuring systemd-resolved either via

# note, is the device via which you access internet - wireless or ethernet 
# interface name can be found via `ip addr` command
systemd-resolve --set-dns=1.1.1.1 --interface=wlp2s0  

or via editing /etc/systemd/resolved.conf to contain the following lines

[Resolve]
DNS=1.1.1.1 

As reported by OP in the comments, they had to restart the system in order to make changes apply, which also suggests a sudo systemctl restart networking would be sufficient without restart.


For multiple DNS servers, Arch Wiki suggests either providing multiple nameserver addresses as in /etc/systemd/resolved.conf.d/dns_servers.conf file:

[Resolve]
DNS=1.1.1.1 1.0.0.1

OR via separate file for fallback nameserver in /etc/systemd/resolved.conf.d/fallback_dns.conf

[Resolve]
FallbackDNS=1.0.0.1

IPv6 addresses can be used just the same

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497