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.
Asked
Active
Viewed 6,123 times
0

RE60K
- 205
2 Answers
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
)

Gansheim
- 871
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
/etc/network/interfaces
to configure your connections. I am sure that you are not. By default, you are using Network Manager. Please check here: http://askubuntu.com/questions/422293/remove-isp-provided-dns/422343#422343 – chili555 Apr 12 '17 at 20:33