Diagnosing DNS lookup problems - possible bad nsswitch.conf or other problem

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












tl:dr my ubuntu 16.04 system often struggles to resolve DNS that my colleagues (mostly using OSX/mac) have no problems with. We're all using 8.8.8.8 from the same wifi network. The domains in question are AWS urls that are frequently created or updated. Having read this question - I fear my nsswitch.conf doesn't make sense.



/etc/nsswitch.conf contains the line:



hosts: files mdns4_minimal [NOTFOUND=return] dns


Does that look right? If I understand rightly it will check (in order) hosts file, mdns (local dns?) then fail before it would check dns servers?



running the command nmcli dev show | grep DNS (from this question - how to know what dns I am using) returns the following:



IP4.DNS[1]: 8.8.8.8
IP4.DNS[2]: 8.8.4.4


I've also checked my hostfile doesn't contain any unexpected clashing entries. Where else should I look for clues?



The DNS lookups fail consistently (ie - it's not a slow DNS server that fails on the first attempt until a value is cached).



An example failed nslookup (with the domain changed to remove work domain) looks like:



> nslookup example.somedomain.com: 127.0.1.1
Address: 127.0.1.1#53

Non-authoritative answer:
*** Can't find example.somedomain.com: No answer


Online nslookup tools can resolve the urls correctly, and reveal that the time to live is 59 seconds, pretty short but not crazy.



Edit: More information (which I don't really understand, but may help an expert) after reading a few more questions:



the above nslookup seems to be using a local DNS server (127.0.1.1) using nslookup but explicitly setting the dns server resolved the URLs correctly:



> nslookup example.somedomain.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: example.somedomain.com
Address: 10.116.[blah].[blah]
Name: example.somedomain.com
Address: 10.116.[blah].[blah]


/etc/NetworkManager/NetworkManager.conf looks like the following:



[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false






share|improve this question


















  • 1




    Try disabling dnsmasq by commenting out dns in NetworkManager.conf. #dns=dnsmasq
    – user822833
    May 9 at 17:49










  • That seems to have worked. @MikaelSchultz Want to make it an answer?
    – Andrew M
    May 22 at 14:19










  • Nice to hear that it worked. Sure I can make it an answer as well :)
    – user822833
    May 22 at 14:32














up vote
1
down vote

favorite












tl:dr my ubuntu 16.04 system often struggles to resolve DNS that my colleagues (mostly using OSX/mac) have no problems with. We're all using 8.8.8.8 from the same wifi network. The domains in question are AWS urls that are frequently created or updated. Having read this question - I fear my nsswitch.conf doesn't make sense.



/etc/nsswitch.conf contains the line:



hosts: files mdns4_minimal [NOTFOUND=return] dns


Does that look right? If I understand rightly it will check (in order) hosts file, mdns (local dns?) then fail before it would check dns servers?



running the command nmcli dev show | grep DNS (from this question - how to know what dns I am using) returns the following:



IP4.DNS[1]: 8.8.8.8
IP4.DNS[2]: 8.8.4.4


I've also checked my hostfile doesn't contain any unexpected clashing entries. Where else should I look for clues?



The DNS lookups fail consistently (ie - it's not a slow DNS server that fails on the first attempt until a value is cached).



An example failed nslookup (with the domain changed to remove work domain) looks like:



> nslookup example.somedomain.com: 127.0.1.1
Address: 127.0.1.1#53

Non-authoritative answer:
*** Can't find example.somedomain.com: No answer


Online nslookup tools can resolve the urls correctly, and reveal that the time to live is 59 seconds, pretty short but not crazy.



Edit: More information (which I don't really understand, but may help an expert) after reading a few more questions:



the above nslookup seems to be using a local DNS server (127.0.1.1) using nslookup but explicitly setting the dns server resolved the URLs correctly:



> nslookup example.somedomain.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: example.somedomain.com
Address: 10.116.[blah].[blah]
Name: example.somedomain.com
Address: 10.116.[blah].[blah]


/etc/NetworkManager/NetworkManager.conf looks like the following:



[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false






share|improve this question


















  • 1




    Try disabling dnsmasq by commenting out dns in NetworkManager.conf. #dns=dnsmasq
    – user822833
    May 9 at 17:49










  • That seems to have worked. @MikaelSchultz Want to make it an answer?
    – Andrew M
    May 22 at 14:19










  • Nice to hear that it worked. Sure I can make it an answer as well :)
    – user822833
    May 22 at 14:32












up vote
1
down vote

favorite









up vote
1
down vote

favorite











tl:dr my ubuntu 16.04 system often struggles to resolve DNS that my colleagues (mostly using OSX/mac) have no problems with. We're all using 8.8.8.8 from the same wifi network. The domains in question are AWS urls that are frequently created or updated. Having read this question - I fear my nsswitch.conf doesn't make sense.



/etc/nsswitch.conf contains the line:



hosts: files mdns4_minimal [NOTFOUND=return] dns


Does that look right? If I understand rightly it will check (in order) hosts file, mdns (local dns?) then fail before it would check dns servers?



running the command nmcli dev show | grep DNS (from this question - how to know what dns I am using) returns the following:



IP4.DNS[1]: 8.8.8.8
IP4.DNS[2]: 8.8.4.4


I've also checked my hostfile doesn't contain any unexpected clashing entries. Where else should I look for clues?



The DNS lookups fail consistently (ie - it's not a slow DNS server that fails on the first attempt until a value is cached).



An example failed nslookup (with the domain changed to remove work domain) looks like:



> nslookup example.somedomain.com: 127.0.1.1
Address: 127.0.1.1#53

Non-authoritative answer:
*** Can't find example.somedomain.com: No answer


Online nslookup tools can resolve the urls correctly, and reveal that the time to live is 59 seconds, pretty short but not crazy.



Edit: More information (which I don't really understand, but may help an expert) after reading a few more questions:



the above nslookup seems to be using a local DNS server (127.0.1.1) using nslookup but explicitly setting the dns server resolved the URLs correctly:



> nslookup example.somedomain.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: example.somedomain.com
Address: 10.116.[blah].[blah]
Name: example.somedomain.com
Address: 10.116.[blah].[blah]


/etc/NetworkManager/NetworkManager.conf looks like the following:



[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false






share|improve this question














tl:dr my ubuntu 16.04 system often struggles to resolve DNS that my colleagues (mostly using OSX/mac) have no problems with. We're all using 8.8.8.8 from the same wifi network. The domains in question are AWS urls that are frequently created or updated. Having read this question - I fear my nsswitch.conf doesn't make sense.



/etc/nsswitch.conf contains the line:



hosts: files mdns4_minimal [NOTFOUND=return] dns


Does that look right? If I understand rightly it will check (in order) hosts file, mdns (local dns?) then fail before it would check dns servers?



running the command nmcli dev show | grep DNS (from this question - how to know what dns I am using) returns the following:



IP4.DNS[1]: 8.8.8.8
IP4.DNS[2]: 8.8.4.4


I've also checked my hostfile doesn't contain any unexpected clashing entries. Where else should I look for clues?



The DNS lookups fail consistently (ie - it's not a slow DNS server that fails on the first attempt until a value is cached).



An example failed nslookup (with the domain changed to remove work domain) looks like:



> nslookup example.somedomain.com: 127.0.1.1
Address: 127.0.1.1#53

Non-authoritative answer:
*** Can't find example.somedomain.com: No answer


Online nslookup tools can resolve the urls correctly, and reveal that the time to live is 59 seconds, pretty short but not crazy.



Edit: More information (which I don't really understand, but may help an expert) after reading a few more questions:



the above nslookup seems to be using a local DNS server (127.0.1.1) using nslookup but explicitly setting the dns server resolved the URLs correctly:



> nslookup example.somedomain.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: example.somedomain.com
Address: 10.116.[blah].[blah]
Name: example.somedomain.com
Address: 10.116.[blah].[blah]


/etc/NetworkManager/NetworkManager.conf looks like the following:



[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false








share|improve this question













share|improve this question




share|improve this question








edited May 9 at 14:39

























asked May 9 at 14:07









Andrew M

6001622




6001622







  • 1




    Try disabling dnsmasq by commenting out dns in NetworkManager.conf. #dns=dnsmasq
    – user822833
    May 9 at 17:49










  • That seems to have worked. @MikaelSchultz Want to make it an answer?
    – Andrew M
    May 22 at 14:19










  • Nice to hear that it worked. Sure I can make it an answer as well :)
    – user822833
    May 22 at 14:32












  • 1




    Try disabling dnsmasq by commenting out dns in NetworkManager.conf. #dns=dnsmasq
    – user822833
    May 9 at 17:49










  • That seems to have worked. @MikaelSchultz Want to make it an answer?
    – Andrew M
    May 22 at 14:19










  • Nice to hear that it worked. Sure I can make it an answer as well :)
    – user822833
    May 22 at 14:32







1




1




Try disabling dnsmasq by commenting out dns in NetworkManager.conf. #dns=dnsmasq
– user822833
May 9 at 17:49




Try disabling dnsmasq by commenting out dns in NetworkManager.conf. #dns=dnsmasq
– user822833
May 9 at 17:49












That seems to have worked. @MikaelSchultz Want to make it an answer?
– Andrew M
May 22 at 14:19




That seems to have worked. @MikaelSchultz Want to make it an answer?
– Andrew M
May 22 at 14:19












Nice to hear that it worked. Sure I can make it an answer as well :)
– user822833
May 22 at 14:32




Nice to hear that it worked. Sure I can make it an answer as well :)
– user822833
May 22 at 14:32










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










There seems to be an issue with the local DNS cache mechanism provided by dnsmasq (which runs at localhost, 127.0.1.1). Not sure exactly what but if you disable the dnsmasq cache and always ask the primary (8.8.8.8) and secondary (8.8.4.4) DNS servers directly instead it might work better.



To disable dnsmasq you edit the file /etc/NetworkManager/NetworkManager.conf and comment out dns=dnsmasq like in the config below:



[main]
plugins=ifupdown,keyfile,ofono
#dns=dnsmasq


Hope it works out for you :)






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1034064%2fdiagnosing-dns-lookup-problems-possible-bad-nsswitch-conf-or-other-problem%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    There seems to be an issue with the local DNS cache mechanism provided by dnsmasq (which runs at localhost, 127.0.1.1). Not sure exactly what but if you disable the dnsmasq cache and always ask the primary (8.8.8.8) and secondary (8.8.4.4) DNS servers directly instead it might work better.



    To disable dnsmasq you edit the file /etc/NetworkManager/NetworkManager.conf and comment out dns=dnsmasq like in the config below:



    [main]
    plugins=ifupdown,keyfile,ofono
    #dns=dnsmasq


    Hope it works out for you :)






    share|improve this answer


























      up vote
      1
      down vote



      accepted










      There seems to be an issue with the local DNS cache mechanism provided by dnsmasq (which runs at localhost, 127.0.1.1). Not sure exactly what but if you disable the dnsmasq cache and always ask the primary (8.8.8.8) and secondary (8.8.4.4) DNS servers directly instead it might work better.



      To disable dnsmasq you edit the file /etc/NetworkManager/NetworkManager.conf and comment out dns=dnsmasq like in the config below:



      [main]
      plugins=ifupdown,keyfile,ofono
      #dns=dnsmasq


      Hope it works out for you :)






      share|improve this answer
























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        There seems to be an issue with the local DNS cache mechanism provided by dnsmasq (which runs at localhost, 127.0.1.1). Not sure exactly what but if you disable the dnsmasq cache and always ask the primary (8.8.8.8) and secondary (8.8.4.4) DNS servers directly instead it might work better.



        To disable dnsmasq you edit the file /etc/NetworkManager/NetworkManager.conf and comment out dns=dnsmasq like in the config below:



        [main]
        plugins=ifupdown,keyfile,ofono
        #dns=dnsmasq


        Hope it works out for you :)






        share|improve this answer














        There seems to be an issue with the local DNS cache mechanism provided by dnsmasq (which runs at localhost, 127.0.1.1). Not sure exactly what but if you disable the dnsmasq cache and always ask the primary (8.8.8.8) and secondary (8.8.4.4) DNS servers directly instead it might work better.



        To disable dnsmasq you edit the file /etc/NetworkManager/NetworkManager.conf and comment out dns=dnsmasq like in the config below:



        [main]
        plugins=ifupdown,keyfile,ofono
        #dns=dnsmasq


        Hope it works out for you :)







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 22 at 14:45

























        answered May 22 at 14:40







        user822833





























             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1034064%2fdiagnosing-dns-lookup-problems-possible-bad-nsswitch-conf-or-other-problem%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

            Trouble downloading packages list due to a “Hash sum mismatch” error

            How do I move numbers in filenames, in a batch renaming operation?