Siduction Forum

Siduction Forum => Software - Support => Topic started by: sunrat on 2017/08/29, 16:25:12

Title: (solved) Change DNS setting
Post by: sunrat on 2017/08/29, 16:25:12
I am trying to set a different DNS server to the default one. I'm connecting via wifi to a modem/router which doesn't allow DNS server setting to be changed. Have tried a few things to no avail:
- nameserver 208.67.222.222 in resolv.conf  This always gets overwritten on restart but I'm not sure by what. resolvconf is not installed
-     nameserver 208.67.222.222 in /etc/network/interfaces.
- prepend domain-name-servers 208.67.222.222 208.67.220.220 in dhclient.conf
- DNS=208.67.222.222 in /etc/systemd/resolved.conf

network-manager is still installed but unused as wifi config is set up in interfaces file. Could this be what is overriding other configs?
Title: Re: Change DNS setting
Post by: pjnsmb on 2017/08/29, 17:03:00
have a look at the chattr command



chattr +i /etc/resolv.conf (stop it being overwritten)
chattr -i /etc/resolv.conf   (cancel)


look at man chattr



Title: Re: Change DNS setting
Post by: sunrat on 2017/08/29, 17:11:20
Thanks pjnsmb. I did find that workaround in searching and will try it as a last resort. I'd still like to know what is overwriting interfaces file.
Title: Re: Change DNS setting
Post by: melmarker on 2017/08/29, 17:47:02
using chattr in that case is the same as killing your wife because she is a bad cook - better would be in case a) if using resolvconf with n-m setting up the networkmanager/resolvconf right - same as without resolvconf. b) help her learn cooking.
Title: Re: Change DNS setting
Post by: piper on 2017/08/29, 18:57:00
Not to say to use google dns, but, a good example, guideline

https://developers.google.com/speed/public-dns/docs/using
Title: Re: Change DNS setting
Post by: sunrat on 2017/08/30, 01:50:17
Thanks for the replies but I'm not using network-manager or resolvconf. This is a desktop system always using the same wifi and connection is set in /etc/network/interfaces. I'm trying to use OpenDNS and it's not configurable in the router.
Would removing/purging network-manager help or could this have unintended consequences?
I don't have a wife either so can't kill her. :D
Title: Re: Change DNS setting
Post by: melmarker on 2017/08/30, 02:05:18
Please post the status of network-manager - and yes, one can purge n-m (ceni and ifupdown and wpa-supplicant are sufficient)
Title: Re: Change DNS setting
Post by: sunrat on 2017/08/30, 02:38:48
Code: [Select]
roger@siduction-brain:~$ nmcli d
Error: NetworkManager is not running.

Code: [Select]
roger@siduction-brain:~$ systemctl list-units |grep network
networking.service                                                                                         loaded active exited    Raise network interfaces                                                         
vnstat.service                                                                                             loaded active running   vnStat network traffic monitor                                                   
network-online.target                                                                                      loaded active active    Network is Online                                                               
network.target                                                                                    loaded active active    Network
 
Title: Re: Change DNS setting
Post by: piper on 2017/08/30, 03:24:10
Does this work for you with the problem of 'overwritten on restart' , I don't use sudo, so ...

Code: [Select]
nano /etc/dhcp/dhclient.conf
Add the following line to the document before the 'require subnet-mask' command

Code: [Select]
supersede domain-name-servers 208.67.222.222,208.67.220.220;
save and exit

Code: [Select]
ifdown eth0 && sudo ifup eth0
You 'might'  be required to change eth0 to your own network device's name if it uses 'Predictable Network Interface Names'.
Title: Re: Change DNS setting
Post by: sunrat on 2017/08/30, 03:31:25
I tried "prepend" in that file to no avail. Will try that tonight (in about 8 hours here).

I'm using dig to show the DNS used, hopefully that is correct:
Code: [Select]
$ dig google.com |grep SERVER
;; SERVER: 192.168.0.1#53(192.168.0.1)
Title: Re: Change DNS setting
Post by: sunrat on 2017/08/30, 08:36:34
Thanks piper, looks like the "supersede" line worked.  :)

Code: [Select]
dig google.com |grep SERVER
;; SERVER: 208.67.222.222#53(208.67.222.222)
Title: Re: Change DNS setting
Post by: piper on 2017/08/30, 16:32:29
Good deal sunrat   :)