I recently traveled to Canada, and once I arrived my Ubuntu 16.10 laptop started having DNS resolution issues after a couple days when it became confused about what country I was in. Initially I could fix this by flushing my DNS in Chrome, but quickly realized that the issue was with my local device.

I have been back in the U.S. for over a month and my laptop remains confused about what country I am in. Eventually, my network access to websites, package repos, or anything else, becomes blocked due to DNS resolution errors. When I visit Youtube (for example), it always has a "Youtube CA" logo in the upper left.

I can temporarily fix this problem by doing:

sudo systemctl restart dnsmasq
sudo systemctl restart dns-clean
sudo systemctl restart pppd-dns

However, after anywhere between five minutes to two hours the DNS resolution problems return. I then have to restart services again to fix DNS resolution errors and regain access to websites. It may be interesting to note that some websites become unresolved due to DNS whereas others are still accessible, and it seems random to me which fall in each category.

My resolv.conf:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

My /run/dnsmasq/resolv.conf looks like:


To answer the questions below, I am connected to the internet via a wired router with Automatic DHCP. However, this problem also occured with multiple WiFi connections I have used since returning from Canada. Both automatic DNS and manual DNS with and cause this problem.

Provider seems to be (using traceroute as requested):

5  be-7725-cr02.56marietta.ga.ibone.comcast.net (  12.183 ms  12.324 ms  12.291 ms
6  hu-0-12-0-7-pe01.56marietta.ga.ibone.comcast.net (  12.114 ms  9.928 ms  9.847 ms
7  as15169-pe01.56marietta.ga.ibone.comcast.net (  35.742 ms  36.479 ms  36.491 ms

I tried the suggestion below of adding prepend domain-name-servers,; to /etc/dhcp/dhclient.conf, restarting the device, and flushing the DNS in Chrome, and I am still unable to access websites due to DNS resolution issues.

Just to be clear on what I mean by DNS resolution issues, the error I am receiving is:

This site can’t be reached

www.example.com’s server DNS address could not be found.


Checking the proxy, firewall, and DNS configuration


  • 127.* is your machine. – choroba Jan 28 '17 at 13:38
  • @choroba Yes I know. That is why I am fixing this by restarting my device's DNS and not blaming Google's DNS. – Matt Schuchard Jan 28 '17 at 13:41
  • 2
    Geolocation by Youtube etc. works by checking your public IP. That has nothing to do with DNS, or "what country your local device thinks it's in". On top of that, you are running some misconfigured local DNS cache (IPs and are not what you'd normally use for localhost), and I'm not sure why you use dnsmask as a cache (you probably don't need a local DHCP server). How do you connect to the internet (VPN?), and what provider does is your public IP belong to (use traceroute etc. on e.g. youtube.com). – dirkt Jan 28 '17 at 16:08
  • @dirkt Thanks for the info. was the default for the packages installed with Ubuntu 16.10. comes from a plugin called landrush that I have installed for software called vagrant. It starts up a mini-DNS server on my local device for virtual instances to network with each other. It is the default IP for that. I can answer the questions in an edit. – Matt Schuchard Jan 28 '17 at 18:07
  • 1
    It does not. The country for the logo is taken from YouTube user account preferences, and is stored in a cookie named PREF. – JdeBP Jan 29 '17 at 0:07

It's best if you use Google or OpenDNS dns server, rather than from your local ISP/router.

sudo gedit /etc/dhcp/dhclient.conf

add this line

prepend domain-name-servers,;

Save the file, restart computer and you are edone.

| improve this answer | |
  • 1
    I tried this with DNS instead of DHCP, but I will go ahead and give this a shot. I have restarted network and DNS services after adding that line and will see what happens. – Matt Schuchard Jan 28 '17 at 18:15
  • restart your PC, use REBOOT not restart service. – Luka Jan 28 '17 at 18:16
  • Ok I tried this and I am still having DNS resolution errors. – Matt Schuchard Jan 28 '17 at 18:22
  • I must tell you, because your youtube is set to Canada that doesn't mean you have DNS resolution errors. Does sites you visit resolve properly? Can you ping those sites on which you are "encountering errors". If you can, then dns is working fine and the issue is within something else. – Luka Jan 28 '17 at 18:23
  • P.S You can change your Youtube location at the bottom of the page. Also i recommend clearing cache and cookies from browser and checking your google account settings. – Luka Jan 28 '17 at 18:24

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.