The problem:
My DNS is getting hijacked by my ISP, when I enter a webpage, sometimes it redirects me to "Download Bill" page.
I've tried to see why this happens, then I found something else. I have DD-WRT in my router, with DNSMASQ for DHCP and DNS, with fixed DNS IPs (Open DNS).
But in Ubuntu, my resolv.conf shows it is using 127.0.0.1
(and so does nslookup
), so not querying the router? But then Connection Info
shows the right information.
What is wrong here?
NetworkManager is the program which (via the resolvconf utility) inserts address
127.0.1.1
intoresolv.conf
. NM inserts that address if an only if it is configured to start an instance of the dnsmasq program to serve as a local forwarding nameserver. That dnsmasq instance listens for queries at address 127.0.1.1.If you wish to see witch
DNS
you use currently type commandYou can set different
DNS
param for each connectionIf you do not want to use a local forwarding nameserver then configure NetworkManager not to start a dnsmasq instance and not to insert that address. In
/etc/NetworkManager/NetworkManager.conf
comment out the linedns=dnsmasq
and restart the NetworkManager service.
In this mode, NetworkManager updates
/etc/resolv.conf
(still via resolvconf) to include the nameserver addresses NetworkManager has for active connections.If you want to disable the resolvconf mechanism for updating resolv.conf and just use a static resolv.conf file, do the following.
dnsmasq is a good thing; I wouldn't disable it: https://help.ubuntu.com/community/Dnsmasq
On the other hand, if the DNS nameserver that is provided by your ISP is getting hijacked, then, by all means, don't use it! You may specify alternate DNS nameservers in Network Manager like this: