[SOLVED] How to change the DNS server in Linux Mint, and should I?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
In answer to ondoho's question, I have entered the set up of the modem-router and done all I can to make it use 8888 and 8844. Similarly with both the Network and Network Connections apps in the program menu. So everything that can be set to 8888 and 8844 is set to 8888 and 8844 as far as I am aware. But it is still not using them.
I wonder if the ISP is forcing all DNS stuff through its own servers?
Two answers further down it suggests using the command gksudo gedit /etc/dhcp3/dhclient.conf But when I use that command I just get something empty or blank with nothing in it.
In the hope that someone can look through it and tell me what the problem is, I paste below an edited version of the current configuration file of my modem-router as I am currently using it. I have edited out some very similar lines. The original file was about 273 lines long. I have also removed blank lines. Unfortunately I do not have a copy of the config file as I originally received it, but I do have one from a few days ago before I tried to change the DNS server.
I'd also be grateful to be told if there is anything in there which is hobbling by download speed. Instantaneous speed may be fast, but for long downloads the speed is no more than around 650kbps.
For most of the time I used it with Windows, so it might be stuffed with extra things due to using several different security add ons then.
The modem-router is old, but still works OK apart from the things mentioned above, so I am still using it. If the problem is only due to the old modem then I shall get a new one.
create user name REDACTED passwd REDACTED
nbsize maxipsess 512
size maxvc 8 max1483vc 8 maxppe 8 maxl2tptunnel 1 maxl2tpsesspertunnel 1 maxl2tppeerrws 4
modify ppp global pppsesstimer 5 ignorewantolan true keepalive enable maxauthtries 0 authretrydelay 15 maxlcpecho 2
modify system model "MT882" vendor "Huawei" systime REDACTED
alpha set /urlblk/status=0
alpha set /misc/u32=0
alpha set /misc/u16=0
alpha set /misc/int=0
alpha set /misc/u8=0
alpha set /misc/u8syncpctime=0
alpha set /misc/trscan=0
alpha set /misc/sntpprimary=time.nist.gov
alpha set /misc/enum=off
alpha set /misc/user=0
alpha set /misc/u32max_dhcp=3232236030
alpha set /misc/u8AutoDNSRELAY=1
alpha set /qos/mode=0
alpha set /qos/p1=0
alpha set /qos/p2=1
alpha set /qos/p3=2
alpha set /qos/p4=3
alpha set /qos/w1=4
alpha set /qos/w2=3
alpha set /qos/w3=2
alpha set /qos/w4=1
alpha set /qos/voice_base=5000
alpha set /qos/voice_end=6000
alpha set /qos/video_base=54000
alpha set /qos/video_end=55000
alpha set /vlan/v_tag_pvc=1
alpha exec
modify bridge mode enable wan2wan disable
modify pfraw global enable
create pfraw rule entry ruleid 66 dir in enable act deny.....ABOUT 15 SIMILAR RULES EDITED OUT
create pfraw rule entry ruleid 15 ifname private dir in act deny
create pfraw rule entry ruleid 16 ifname private act deny
.....ABOUT 18 SIMLIAR RULES EDITED OUT
create pfraw rule entry ruleid 35 ifname private dir in act callmgmt
create pfraw rule entry ruleid 36 ifname dmz dir in act callmgmt
create pfraw rule entry ruleid 37 dir in act callmgmt
create pfraw subrule entry ruleid 66 subruleid 1 mask 0xFFFFFFFFFFFF offset 6 cmpt eq 0x000000000000
...........ABOUT 15 SIMILAR RULES EDITED OUT
create pfraw subrule entry ruleid 15 subruleid 1 mask 0xFFFF offset 12 enable cmpt range 0x8863 0x8864
..............ABOUT 25 SIMILAR RULES EDITED OUT
modify fwl global blistprotect enable attackprotect enable dosprotect enable maxsinglehostconn 70
create ipf rule entry ruleid 1007 ifname public dir in transprot eq num 17 destport eq num 69 seclevel high
............ABOUT 28 SIMILAR RULES EDITED OUT
modify ipf global seclevel high pubdefact accept dmzdefact accept
modify dhcp server cfg enable
create dhcp server pool start-ip 192.168.1.3 poolid 0 end-ip 192.168.1.65 mask 255.255.255.0 mlease 172800 dns 8.8.8.8 sdns 8.8.4.4
create snmp comm community ADSL rw
create snmp host ip 0.0.0.0 community ADSL
create snmp host ip 255.255.255.255 community ADSL
modify snmp trap disable
create rip intf ifname ppp-0
create ethernet intf ifname eth-0 ip 192.168.1.1 mask 255.255.255.0 extifindex 10000 cpeipindex 0
create usb intf ifname usb-0 ip 192.168.1.2 mask 255.255.255.0
modify ip cfg ttl 64
modify dsl config adsl2plusauto annex adsl2plus framing3 txatten 1 maxbits 15 rxstart 6 rxend 511 duallatency disable maxdnrate 0x1ff autosraenable disable powermanagementmode l2l3notallwd profile mii sra disable
create atm port enable ifname atm-0 maxvc 8 oamsrc 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
create ppp security ifname default
create ppp security ifname ppp-0 login REDACTED-PHONE-NUMBER@REDACTED-ISP extifindex REDACTED passwd REDACTED
create atm trfdesc trfindex 0
create atm vc intf ifname aal5-0 lowif atm-0 vpi 0 vci 38 a5maxproto 1 extifindex 150000 vcmux
create atm vc intf ifname aal5-7 lowif atm-0 vpi 1 vci 39 a5maxproto 2 extifindex 150001
modify ppe cfg padrmax 3 padrtime 1
create ppp intf ifname ppp-0 startondata mru 1500 lowif aal5-0 droute true ppoa outside usedns true extifindex 210000 inacttimeout 30 cpeipindex 1 mtu 1432
modify nat global tcpidletimeout 4800 tcpclosewait 15 tcptimeout 15 udptimeout 60 defnatage 15 portend 60000 enable
create nat rule entry ruleid 1 napt
create alg port portno 21 prot num 6 algtype ftp
............ABOUT 28 SIMILAR LINES EDITED OUT
create bridge port intf ifname eth-0
create bridge port intf ifname usb-0
modify stp port info ifname eth-0 priority 0x80 pcost 100
modify stp port info ifname usb-0 priority 0x80 pcost 100
create dhcp relay intf ifname eth-0
create dhcp relay intf ifname usb-0
create dhcp relay intf ifname ppp-0
create igmp intf ifname eth-0
create igmp intf ifname usb-0
create dns servaddr priority 0 8.8.8.8
create dns servaddr priority 1 8.8.4.4
modify mctl inactivity timeout 1800
modify hdlceoc cfg status enable
create ilmi intf ifname atm-0
modify ilmi access protocol ifname atm-0 vpi 0 vci 38 proto any
modify ilmi access protocol ifname atm-0 vpi 1 vci 39 protextnflag static bridgemode enable proto bbrouter
trigger ilmi
END
This would be for an interface with an id of enp0s8. (Use ip link show to see what interfaces you have.)
In this example, there is a dnsmasq daemon running at 192.168.1.101, which this computer is expected to consult before going on to Google's public servers. This computer is part of a domain named MyDomain.
When a command such as ifup enp0s8 is executed, or is executed automatically at startup, a variety of commands are issued internally which update several of the files (such as /etc/resolv.conf) which other programs expect to refer to. But, as the prologue comments in those files now indicate, those reference files are completely overwritten in the process.
There are no particular negative implications to changing the DNS reference. However, servers are queried in the order listed so "local" domain servers should come first. It is also possible to just use a single, local, domain server that knows how to query a list of downstream servers given to it, and then to cache their responses for a time.
Last edited by sundialsvcs; 01-24-2017 at 08:46 AM.
Thank you sundialsvcs. I entered ip link show but I do not know what the id would be or what any of it means in what was returned:
$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 00:13:72:e8:ba:7b brd ff:ff:ff:ff:ff:ff
In answer to pan64, if I enter "nslookup google.com" or "cat /etc/resolv.conf" I get an answer of "127.0.1.1".
Should I try hydrurga's suggestion above for OpenDNS with 8888 and 8844 sustituted, and if that does not work try the OpenDNS settings?
I had started to try hydrurga's suggestion of changing the DNS server to OpenDNS, but the computer says there is so such thing as a "xed" command, so it will not work.
Similarly, the computer says there is no such thing as the "auto" command.
I had started to try hydrurga's suggestion of changing the DNS server to OpenDNS, but the computer says there is so such thing as a "xed" command, so it will not work.
xed is a "Mint thing, (circa 18), I believe, any text editor will do.
In answer to pan64, if I enter "nslookup google.com" or "cat /etc/resolv.conf" I get an answer of "127.0.1.1".
not sure if i'm being stupid, but doesn't that suggest that the router provides dns? or, whatever is at 127.0.1.1?
grumpyskeptic, you do have internet connectivity and DNS, right? it's working?
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
127.0.1.1 is a loopback address -- just points to your own machine.
Usually, with a home router setup, I find Linux will get it's DNS settings through DHCP (along with it's subnet mask and default gateway) and the DHCP server is usually set to the router. The router itself then consults the DHCP server as required -- in my case it's currently hard-wired to my ISP.
Personally, the only way I've tested my DNS server settings was to to go a page which did not exist and see whether I saw my ISPs "page not found" search page or OpenDNS's.
So, if I were able to change the DNS setting on my router (or if I bother to on one of my attached devices) and wanted to test things worked I'd change to OpenDNS then mis-type domains until I got either my ISPs page, showing it didn't work, or OpenDNSs showing it did work. Easy.
Not sure what's going on with the resolve.conf though as mine just shows:
Code:
cat /etc/resolv.conf
nameserver 192.168.0.1
Because, as I mentioned, it's just using the gateway.
I tried the command suggested by pan64 above and got the below. Every "dnsmasq" was in red, which I have never seen before. I have no idea what any of it means.
you can see here listen-address, this will be therefore used, that's why nslookup printed 127.0.1.1
Probably the real DNS server is used by dnsmasq, but probably dnsmasq uses the router and router uses real DNS server. I cannot see that from here.
ip link show tells you that your ethernet adapter is named eth0. (Whereas, on my Linux, it might be enp0s3.) You need this to know how to correctly set various configuration files.
To see how a particular DNS-name is being resolved, or not, try: dig google.com.
This command will make a name-resolution query, tell you if the request succeeded (NOERROR) or not (e.g.NXDOMAIN), what the answer was, and which DNS server gave you that answer.
Of course, nslookup will give you similar information, but it seems clear that the output of this command is especially designed to be easily parsed by a shell-script. It's fine if the lookup works, but IMHO it gives you generally less information than might be needed to resolve a name-resolution problem.
If you see a response coming back from 127.0.0.1(a.k.a. localhost), that necessarily means that there is a DNS service, such as dnsmasq, running on your computer, and that your computer is set to consult it. The configuration file for that service will tell you which other DNS servers it is consulting, but you won't be able to see that. You need to find the appropriate log file (in /var/log to sleuth it from there.
If you see a response coming back from (say ...)192.168.0.1, it means that your router is running a DNS service, and the same rules apply: you must consult your router's configuration screens to see what list of DNSes it is consulting to find the answers that it's giving you. All routers have a logging function that is ordinarily turned off.
The client software that handles DNS queries can also be problematic. For instance, OS/X currently ships with mDNSResponder, which has the annoying habit of caching responses includingNXDOMAIN. If told that a domain doesn't exist, it won't readily ask again, even if downstream conditions have changed. Other DNS clients typically cache positive responses only. But, you do need to be aware that cacheing can and does occur at any point: your DNS-client might cache answers, and any intermediate DNS-server might cache, too.
Last edited by sundialsvcs; 01-25-2017 at 09:00 AM.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by sundialsvcs
If you see a response coming back from 127.0.0.1(a.k.a. localhost), that necessarily means that there is a DNS service, such as dnsmasq, running on your computer, and that your computer is set to consult it.
Would you see similar if the hosts file were used? How about if the address were retreived from DNS cache, rather than querying the server? Sorry, just asking for my own knowledge as I don't know as much about thses things as I should and the question seems inkeeping with the issue here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.