Thoughts, notes & the occasional opinion.

Manually Setting DNS Server Addresses in Ubuntu (Linux)

No matter how many times I have installed and configured Linux, I can never remember the name of the configuration file that stores the DNS/Nameserver details. This really only applies if your Linux machine is using a static IP address. In most scenarios, it does not apply to DHCP clients.

DNS server settings are stored in /etc/resolve.conf To edit this file, enter the following command from the shell

1
$sudo nano /etc/resolv.conf

(If you have installed XWindows/Gnome, you can use sudo gedit /etc/resolve.conf instead)

Add the entries for your DNS or nameservers as follows

1
2
nameserver <IP address of DNS server 1>
nameserver <IP address of DNS server 2>

etc…

1 Comment

  1. andrew winter

    Thanks for that – It fixed a scheduled task issue on one of my 2003 servers.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2025 Alexander John

Theme by Anders NorĂ©nUp ↑