{"id":3198,"date":"2012-10-08T16:00:00","date_gmt":"2012-10-08T16:00:00","guid":{"rendered":"http:\/\/localhost:8105\/?p=3198"},"modified":"2021-12-05T08:55:10","modified_gmt":"2021-12-05T08:55:10","slug":"overriding-isp-provided-dns-server","status":"publish","type":"post","link":"https:\/\/blog.shahada.abubakar.net\/?p=3198","title":{"rendered":"Overriding ISP Provided DNS Server"},"content":{"rendered":"<div id=\"content\"><b>Overriding ISP Provided DNS Server in Ubuntu 12.04<\/b>If you&#8217;re on Ubuntu 12.04, you&#8217;ll notice how DNS severs are no longer set in \/etc\/resolv.conf, rather \/etc\/resolv.conf points to 127.0.0.1, and NetworkManager runs an instance of dnsmasq that dynamically changes your DNS server based on the settings obtained from your network. It handles cases where you switch networks well.<\/p>\n<p>Except if you live in a country where sites are blocked via the ISP&#8217;s DNS &#8230; and would rather override the ISP&#8217;s suggested DNS server with Google&#8217;s free DNS server at 8.8.8.8.<\/p>\n<p>Well there&#8217;s a good article on how Ubuntu 12.04&#8217;s DNS resolving works at <a class=\"ot-anchor bidi_isolate\" dir=\"ltr\" href=\"http:\/\/www.stgraber.org\/2012\/02\/24\/dns-in-ubuntu-12-04\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.stgraber.org\/2012\/02\/24\/dns-in-ubuntu-12-04\/<\/a>.<\/p>\n<p>In short, I managed to override it on my desktop and laptop by appending &#8220;nameserver 8.8.8.8&#8221; to \/etc\/resolvconf\/resolv.conf.d\/head.<\/p>\n<p>For servers, where network manager is not in use, and you use static IP adressing, the DNS server can now go into the \/etc\/network\/interfaces file &#8230; under the iface as &#8220;dns-nameservers&#8221;, as described here:\u00a0<a class=\"ot-anchor bidi_isolate\" dir=\"ltr\" href=\"http:\/\/www.jansipke.nl\/ubuntu-12-04-network-configuration\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.jansipke.nl\/ubuntu-12-04-network-configuration\/<\/a>.<\/p>\n<p>Update: An alternative way to force a fixed DNS server is to hack dhclient &#8230; as described here:\u00a0<a class=\"ot-anchor bidi_isolate\" dir=\"ltr\" href=\"http:\/\/www.liberiangeek.net\/2012\/05\/setup-static-dns-servers-in-ubuntu-12-04-precise-pangolin\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.liberiangeek.net\/2012\/05\/setup-static-dns-servers-in-ubuntu-12-04-precise-pangolin\/<\/a> &#8230; but this only works for DNS supplied via DHCP.<\/p>\n<p>UPDATE 2012-10-28: &#8230; this works until you are on a &#8220;captive portal&#8221; wifi network that uses &#8220;DNS Poisoning&#8221; to get you to the acces control page. In those situations, you will need to undo this and use the DNS provided by DHCP, at least until authenticated.<\/p>\n<p><a class=\"ot-hashtag bidi_isolate\" href=\"https:\/\/plus.google.com\/s\/%23ubuntu\/posts\" rel=\"nofollow\"><a href=\"https:\/\/blog.shahada.abubakar.net\/?tag=ubuntu\">#ubuntu<\/a><\/a> \u00a0 <a class=\"ot-hashtag bidi_isolate\" href=\"https:\/\/plus.google.com\/s\/%23dns\/posts\" rel=\"nofollow\">#dns<\/a><\/p>\n<hr \/>\n<p>LINK:<br \/>\n<a href=\"http:\/\/www.stgraber.org\/2012\/02\/24\/dns-in-ubuntu-12-04\/\"><img decoding=\"async\" src=\"https:\/\/blog.shahada.abubakar.net\/wp-content\/uploads\/2012\/10\/1.php\" \/><br \/>\nDNS in Ubuntu 12.04 | St\u00e9phane Graber&#8217;s website<\/a><\/p>\n<hr \/>\n<p>Comments (3):<\/p>\n<ul>\n<li><i>2014-05-08 02:38:02+0800 Sem Brignoli<\/i> But how did u append the # Dns to the \/etc\/resolvconf\/resolv.conf.d\/head. if the files quote that all manual changes will be overwritten?<\/li>\n<li><i>2014-05-12 12:33:39+0800 shahada abubakar<\/i> <span class=\"proflinkWrapper\"><span class=\"proflinkPrefix\">+<\/span><a class=\"proflink bidi_isolate\" href=\"https:\/\/plus.google.com\/110453742744442098016\">Sem Brignoli<\/a><\/span> The &#8220;head&#8221; and &#8220;base&#8221; files form a template that are merged together with DNS server addresses into the actual \/etc\/resolv.conf file. The message about not editing by hand in the &#8220;head&#8221; file is intended to be read after its been merged into \/etc\/resolv.conf. \ud83d\ude0e Did you have any problem with your changes disappearing from the &#8220;head&#8221; file?<\/li>\n<li><i>2014-05-12 12:36:11+0800 Sem Brignoli<\/i> Mm.. Not yet&#8230; I&#8217;m trying to get a new more customizable router to make it easier and faster.. If I can I will keep trying.. Thanks thought<\/li>\n<\/ul>\n<p><i>This post was originally <a href=\"https:\/\/plus.google.com\/+shahadaabubakar\/posts\/WHgtXtQykdE\">published<\/a> publicly on <a href=\"http:\/\/plus.google.com\">Google+<\/a> at 2012-10-09 02:48:17+0800<\/i><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overriding ISP Provided DNS Server in Ubuntu 12.04If you&#8217;re on Ubuntu 12.04, you&#8217;ll notice how DNS severs are no longer set in \/etc\/resolv.conf, rather \/etc\/resolv.conf points to 127.0.0.1, and NetworkManager runs an instance of&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[116],"tags":[22],"class_list":["post-3198","post","type-post","status-publish","format-standard","hentry","category-linux","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/blog.shahada.abubakar.net\/index.php?rest_route=\/wp\/v2\/posts\/3198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.shahada.abubakar.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.shahada.abubakar.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.shahada.abubakar.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.shahada.abubakar.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3198"}],"version-history":[{"count":2,"href":"https:\/\/blog.shahada.abubakar.net\/index.php?rest_route=\/wp\/v2\/posts\/3198\/revisions"}],"predecessor-version":[{"id":6806,"href":"https:\/\/blog.shahada.abubakar.net\/index.php?rest_route=\/wp\/v2\/posts\/3198\/revisions\/6806"}],"wp:attachment":[{"href":"https:\/\/blog.shahada.abubakar.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.shahada.abubakar.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.shahada.abubakar.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}