Report this

What is the reason for this report?

Change DNS server on Ubuntu 24

Posted on March 27, 2026

I am having a hard time finding instructions for changing the dns provider for my droplet. It is connected to an internal network over wireshark and want to use that network’s dns servers to resolve names instead of the digital ocean 67.207.67.3 and 67.207.67.2 so I can access internal services. All I can find is for Ubuntu 20 or earlier, none of which are consistent or seem to be workingon my Ubuntu 24.04/4 LTS server.

Side note, will doing so interfere with connecting with Digital Ocean services like my hosted posgres database?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
0

Accepted Answer

Heya,

On Ubuntu 24.04, DNS is managed by systemd-resolved. To change your DNS servers, edit /etc/systemd/resolved.conf:

[Resolve]
DNS=<your-internal-dns-ip>
FallbackDNS=67.207.67.2 67.207.67.3

Then restart the service:

sudo systemctl restart systemd-resolved

You can verify with resolvectl status to confirm it picked up the new servers.

Your managed Postgres connection string uses a hostname that resolves publicly, so as long as your internal DNS can resolve external domains (or you keep the DO nameservers as fallback like above), it should be fine. If your internal DNS only resolves internal names and nothing else, that’s where you’d run into issues.

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.