Linux – Add or edit DNS-server

In most Linux distribution the nameservers are stored in the file /etc/resolv.conf

So you can edit it via:

$> sudo nano /etc/resolv.conf

You will see something like that:


As you can see all nameserver entries follow the pattern:

nameserver IPADRESS

When searching for an DNS-Server the list is processed top down. The first entry that is reachable and can resolve the hostname delivers the IP for the request. (first entry wins)


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.