I’d like to post a solution to a problem I’ve encountered in my university. The issue is closely related to this post. I asked the user whether or not he found a solution but he never responded. In addition, I’m not sure whether or not this solution is case-specific or general.
In one of my university’s buildings, public wi-fi would work only with ip addresses, but not with domain names. For instance, I could
ping 188.8.131.52 or go to google in firefox by
184.108.40.206 ip address, but
ping google.com or accessing
google.com in firefox would not work.
I will post solution to my problem bellow. Feel free to add other responses or other solutions for other users who may encounter similar issues.
Here is Solutions:
We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.
Once I’ve encountered this issue, I’ve been researching it for a while, and figured out that this may be dns problem. By reading this post, I’ve learned that there is number of ways to add or supersede the DNS servers provided by your network, however none of the solutions seemed to work. As user brad mentioned, dns is still being controlled by dnsmasq.
Now, by poking around config files in
/etc/ I found the
/etc/NetworkManager/NetworkManager.conf file, which had the following information:
[main] plugins=ifupdown,keyfile,ofono dns=dnsmasq [ifupdown] managed=false
I’ve changed the
dns line, and now the file reads like this:
[main] plugins=ifupdown,keyfile,ofono #dns=dnsmasq dns=220.127.116.11 [ifupdown] managed=false
After restarting Network Manager with
sudo service network-manager restart everything started working properly, and the solution still works after rebooting.
Note: 18.104.22.168 is OpenDNS public server.
What may have happened:
While on the network, the output of
nm-tool was the following:
DNS: 22.214.171.124 DNS: 126.96.36.199 DNS: 188.8.131.52 DNS: 184.108.40.206
I believe, my uni has their own DNS server, which is 220.127.116.11 and .10, and dnsmasq queries the closest one, so my requests never even got to 18.104.22.168.
Hope this solutions helps to other users, and please let me know if my solution to this problem is valid, safe enough, or reasonable enough.
Concerning answering my own question:
I’m doing so to make this solution public and documented, at least for my particular case. Also I’d like to reference this post on meta.askubuntu.com.
Having returned home from uni today, I’ve discovered that I couldn’t connect to my home wifi. I’ve read-up a little on
man NetworkManager.conf and it turns out that
[main] is actually a line for plug-ins, so line
dns=dnsmasq is actually adding dnsmasq plugin to the network manager, apparently. So my solution still worked, just not as expected. Here’ss excerpt from the man page:
List DNS plugin names separated by ‘,’. DNS plugins are
used to provide local caching nameserver functionality
(which speeds up DNS queries) and to push DNS data to
applications that use it.
So by setting
dns=22.214.171.124 I may have, basically, prevented network manager from using that plug in, which would otherwise use local dns server (which apparently doesn’t work).
What I’ve done so far is to comment out dnsmasq and ditch my internet service provider’s DNS. Now, telling Network Manager is explained in this post, and it’s a GUI method: simply open the Network Manager indicator, select “Edit Connections”, open your network’s name by pressing “Edit”, and under IPv4 Settings tab, choose “Automatic (DHCP) addresses only “.
The very same thing can be done in command line , by editing a file for your specific connection stored in
Bellow is the relevant portion of my connection file:
[ipv4] method=auto dns=126.96.36.199; ignore-auto-dns=true [ipv6] method=auto
Now, with all these configurations (commented out dsnmaq plug-in from NetworkManager.conf and connection set to Automatic(DHCP) addresses only), I’ve basically achieved all that i was trying to get going all along – get my machine connect by domain names, and somehow get around using university’s dns server, because that wone got me nowhere.
nm-tool confirms that I am using the DNS I wanted as well as
dig google.com and
This is the last update on this question/answer, and I don’t plan adding anything else, but feel free to add any relevant information as a separate answer or in comments, as well as suggestions.
Hope this helps to other Ubuntu users, and Linux users in general !
Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂