[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.
- but there is little advice about doing this in Linux.
Supplementary question, is it worth doing? Will it improve security and privacy? What about logging on to banking websites etc?
My ISP has already had a lot of phone numbers stolen and I am frequently telephoned by scammers from abroad as a result. I feel it is only a matter of time before the ISP customer usage logs are hacked or lost or mistakenly published.
Thanks
Last edited by grumpyskeptic; 01-21-2017 at 11:18 AM.
i did, i do.
i don't know if one "should".
fwiw, i use and prefer opennic servers.
they have quick instructions for ubuntu and a wiki.
be warned that depending on your system the way to achieve it varies.
if, for example, one were to use systemd's resolved, one would have to edit /etc/systemd/resolved.conf accordingly, and restart the service.
not sure what linux mint / ubuntu is up to these days.
If you were to get a router, you would be able to enter the nameservers of your choice in your router's configuration. They would then be the defaults for your network.
Exactly how to do so will depend on your make/model of router.
The Linux Mint 17.3 installed on my computer does not have any resolv.conf that I can find, it uses something else.
It seems to be easier to change the DNS details for the modem-router, which is independent of the operating system, and I found clear advice about how to do that here http://setuprouter.com/
Changing the modem-router details also gives me the opportunity to change the default factory username and password for it.
Which leads to another question:
If I change the username and the password on my modem-router, will Linux Mint 17.3 Cinnamon still be able to use it? Won't I have to tell it what the new username and passwords are?
Thanks.
Update - I have just looked at the existing DNS details on my modem-router, and both the primary and secondary DNS Server are set to 0.0.0.0, and the DNS relay (whatever that is) is set to "enable". Are these as expected, or are they unusual please? Thanks.
Last edited by grumpyskeptic; 01-22-2017 at 04:30 AM.
Reason: updated info
If you were to get a router, you would be able to enter the nameservers of your choice in your router's configuration. They would then be the defaults for your network.
probably more elegeant.
but doesn't the desktop computer's operating system still search for and supply "its own" nameservers, unless it is told that the router already provides them?
If you were to get a router, you would be able to enter the nameservers of your choice in your router's configuration. They would then be the defaults for your network.
Sweet idea, but not so practical if you have a laptop that you're going to connect to different routers.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by grumpyskeptic
Changing the modem-router details also gives me the opportunity to change the default factory username and password for it.
Which leads to another question:
If I change the username and the password on my modem-router, will Linux Mint 17.3 Cinnamon still be able to use it? Won't I have to tell it what the new username and passwords are?
Wow! Change that username and password now! That's a huge wide-open security flaw on your setup right there!
The username and password are only used for configuration so the computer "doesn't need to know it" you need to know it in case you want to do things like change the DNS settings.
The reason I say it's a huge security hole is that it is possible for websites to be set up in such a way that they will redirect your browser to log into your router and change things like DNS so that you are redirected to malicious sites. This isn't common, or easy to do, but having default settings is bad for that reason. You should also ensure that your router doesn't allow settings to be changed from the WAN port (it will be in the configuration settings if it's an option which can be allowed) as that means anyone on the internet can log into your router.
Quote:
Originally Posted by hydrurga
Sweet idea, but not so practical if you have a laptop that you're going to connect to different routers.
That's a slightly more complex topic. It could be said it's darn good to have one's own DNS settings when on any network as it's potentially safer. However, if one wants to use a "captive portal" such as a "public" network at a place of work, Starbucks, hotel or wherever for some casual browsing having DNS set up could stop the login page from appearing. It could be argued, and I'd not object, that using a captive portal network like that is risky but they're a fact of life that some of us risk.
That's a slightly more complex topic. It could be said it's darn good to have one's own DNS settings when on any network as it's potentially safer. However, if one wants to use a "captive portal" such as a "public" network at a place of work, Starbucks, hotel or wherever for some casual browsing having DNS set up could stop the login page from appearing. It could be argued, and I'd not object, that using a captive portal network like that is risky but they're a fact of life that some of us risk.
Agreed, but for some of us who travel a lot, the choice isn't just between our home router and "captive portals". We have friends, colleagues etc. whose routers we access while on the hoof. Hence my reason for setting my DNS servers locally in the operating system - it allows for greater flexibility.
Personally, I think using a VPN is the way to go if connected to a public wifi network - it helps assuage the risk.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by hydrurga
Agreed, but for some of us who travel a lot, the choice isn't just between our home router and "captive portals". We have friends, colleagues etc. whose routers we access while on the hoof. Hence my reason for setting my DNS servers locally in the operating system - it allows for greater flexibility.
Personally, I think using a VPN is the way to go if connected to a public wifi network - it helps assuage the risk.
Well, yes, but using the DNS of the gateway will work in all those situations and when using a VPN you'll wnat to be using the gateway DNS also. I can't think of a situation where using your own DNS is going to be easier and only a few where it's going to be more secure and those could potentially mean changing it from the gateway to your own after a captive portal has been used, for example.
For travelling I'm a great fan of using my phone as a router since I'm one of those people who pays for more data than they could possibly use and roaming also.
I have updated both my modem-router and the details in Linux to the Google DNS servers 8.8.8.8 and 8.8.4.4, but it does not seem to make any difference, despite spending all morning on it and restarting both my computer (which is a desktop) and the modem-router twice. .
The first method, the command "nslookup google.com" returns:
Server: 127.0.1.1
Address: 127.0.1.1#53
The second method, the command "cat /etc/resolv.conf" returns:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
As you can see, neither of them show I am using the Google DNS server, despite have the 8888 and 8844 numbers visible in the Network Connections program from the menu, the other network program from the taskbar, and also in the modem itself.
So what to do next please?
Update - The situation has not changed overnight. My guess is the difficulty may be due to three (or more) possible reasons:
1) My ISP address is not fixed but changes every time I switch the modem-router on. I think I may have Dynamic DNS, not static.
2) Although I have entered 8888 and 8844, I think these may only be later entries on a list, and that the first entry on the list "127.0.1.1" has not been changed.
3) Something within Linux Mint 17.3 Rosa Cinnamon may be overwriting whatever changes I make. Strangely, neither of the two networking apps require any administrative privelidges to make changes, which could be because any changes will be overwritten anyway.
4) Maybe I need to flush the DNS - will have to look that up online.
5) Might be that my modem-router, supplied by my ISP, has been fixed so that you cannot do what I want to do.
Is there any suitable GUI software that can do all the above easily? However I could not use it if it requires entering all the parameters manually as they are fiendishly opaque and there are so many of them, so I would loose all connectivity.
I am quite tempted to buy my own modem-router, especially since the bandwidth I get with the current one is extremely low, but it would have to work when plugged in since I would not know how to set it up.
Last edited by grumpyskeptic; 01-23-2017 at 06:23 AM.
Reason: update
but doesn't the desktop computer's operating system still search for and supply "its own" nameservers, unless it is told that the router already provides them?
i gave this some thought (it's been a while since i set up my network and even longer since i used a gui tool) and realized:
it's the other way round.
most linux desktops will default to use whatever DNS servers are offered through the ISP or router and only through user effort will they use different DNS servers.
I have updated both my modem-router and the details in Linux to the Google DNS servers 8.8.8.8 and 8.8.4.4, but it does not seem to make any difference
how did you do that and what difference did you expect it to make?
if you edited /etc/resolv.conf, that will most likely be overwritten by whichever tool creates network connections!
that is most likely networkmanager, and i know for a fact that you can gui-edit connections to use different dns servers: https://askubuntu.com/a/2325
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.