0

This question already has an answer here:

The internet on my network works with primary dns a.b.c.d and alternate as e.f.g.h and everytime I need it to work I need to append nameserver a.b.c.d and nameserver e.f.g.h to /etc/resolv.conf. Isn't there an easier way to do this that probably doesn't involve me doing this when PC restarts, I tried scripts, it works but it just seems as a hack.

marked as duplicate by muru, Zanna, Fabby, Community Apr 13 '17 at 10:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

Manually add those name servers in your /etc/network/interfaces file by inserting the line dns-nameservers a.b.d.c e.f.g.h underneath the interface(s) you are using (usually either eth0 or wlan0)

1

You can either do it by adding the DNS server in the /etc/network/interfaces adding the parameter dns-nameservers separating each DNS server with a space as following:

dns-nameservers 1.2.3.4 5.6.7.8

Example:

dns-nameservers 8.8.8.8 10.10.10.254

You can also edit the file /etc/resolvconf/resolv.conf.d/base and edit it the same way you edit the /etc/resolv.conf

Example:

nameserver 8.8.8.8
nameserver 10.10.10.254
search domain.local

Not the answer you're looking for? Browse other questions tagged or ask your own question.