Ubuntu Configure systemd-resolved

Latest Ubuntu/Debian use systemd-resolved for DNS resolution. On a fresh Ubuntu 19.04 install DNS failed to resolve.

root@ubuntu19:/# ping serverok.in
ping: serverok.in: Temporary failure in name resolution
root@ubuntu19:/# 

To fix this, create file

mkdir /etc/systemd/resolved.conf.d/
vi /etc/systemd/resolved.conf.d/dns_servers.conf

Add content

[Resolve]
DNS=8.8.8.8 1.1.1.1

Restart systemd-resolved

systemctl restart systemd-resolved

You can find systemd-resolvd status with command

resolvectl status
systemd-resolve --status

To resolve a domain, use

resolvectl query serverok.in

Need help with Linux Server or WordPress? We can help!

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *