I just switched to Ubuntu 14.0.4 from Windows 7 using dual boot mode. I am connecting to my office's network using wireless wlan0. I am experiencing issues when trying to ssh to access several Linux host. The hostname is not resolving to an IP. I checked /etc/resolv.conf and /etc/network/interfaces. There's no static DNS defined. I am obtaining an IP via DHCP. I have did not experience issue with Windows 7 basically.

To workaround I have to manually insert DNS and search domain in the /etc/network/interfaces file. Thereafter I am able to ssh to Linux as the hostname now translates an IP. Confirmed with nslookup.

However the problem comes when I get home on home's network. I noticed upon booting up my laptop into Ubuntu, firefox takes a while to translate a URL and noticeably slow. However once the website loads up it speed up. I did some website benchmark no issues with speed. I am highly suspecting due to DNS settings. When I comment off the DNS servers (which is my office's one), things are back to normal. My ISP indicated that no DNS is required to specify as we are assigned IPs through DHCP.

For the time being, I am doing manual comment/uncomment DNS entries to flick the switch :P Not sure if there's a better way to solve this.


  • Just curious, why not use the nm-connection-editor tool to specify a DNS server address? Assuming you are not on a server distro (you mentioned windows), using the GUI has less chances of you screwing up things. In nm-connection-editor keep your office/isp dns address and a public one like OpenDNS or Google's DNS, that way you will have a public one as fallback just in case your ISP/office dns server is somehow restricting certain sites – trve.fa7ad Sep 24 '14 at 13:47
  • I did. As a novice Ubuntu user, I clicked on the Wifi icon on the upper right hand corner --> Edit connections. I noticed it's the same GUI. In fact I installed the "network-admin" through apt-get repo to get my settings sorted. However seems no luck. BTW, I only specify office's DNS. Isp dns is not required. – Haans Sep 24 '14 at 14:07
  • try adding a public one off.ice.ip.adr, <- in this format in the edit connection window. ISPs often claim a lot of stuff that might not work well for everyone. just try with a public dns and keep us posted here – trve.fa7ad Sep 24 '14 at 18:49

Thank you for your help. I managed to solve my problem. My bad. Slapped my wrist.

nmcli dev list iface eth0 returns correct DNS information. My office's DNS is giving correct DNS and IP. What happened was the DNS server returned domain A (local office). However I was trying to connect to another site (domain B). Hence nslookup and ssh without the domain B supplied will return error.


ssh hostname (Does not work)
ssh hostname.domainB.com (works) 

This is because even though I am connected successfully to the network. I am with domain A. I figured out that I need to append my dns suffix in /etc/resolvconf/tail to overcome this otherwise I need to specify domainB each time.

To add one more important observation. It took me a while to troubleshoot as nslookup and /etc/resolv.conf always points to It confuses me as to why it goes to local DNS than my DNS server. I found it is the way Ubuntu Desktop uses resolvconf and local DNS and it is specified in /etc/NetworkManager/NetworkManager.conf (entry dns=dnsmasq).


My ISP indicated that no DNS is required to specify as we are assigned IPs through DHCP

Most probably your ISP wanted to say that you are, together with your IP (and possibly a default gateway), assigned a DNS through DHCP.

Check this using the command nmcli dev list iface eth0 | grep IP4 in a terminal, you then see if your system gets its DNS via DHCP.

You could also check the leases file manually using less /var/lib/dhcp3/dhclient.leases and look for "dns". Note that at some time, the path and filename changed to /var/lib/dhclient/dhclient-ethX.leases.

If the DHCP server does not assign a DNS, check with your ISP and the sysadmins in your office.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.