Issue with DNS resolution in resolve.conf with static IP

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








up vote
0
down vote

favorite












Apologies if this has been answered before, I searched and couldn't find a solution.



I have setup my ubuntu 16.04 desktop with a static IP. However on startup it is not able to resolve hostnames. Surprising if I manually restart the network service with:



sudo /etc/init.d/networking restart


It fixes my DNS issue. But I have to do this every time on startup.



I think the issue is with how my resolve.conf file is being auto-written on boot.



For example on boot up it has:



ow@ubuntu002:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
dns-nameservers 8.8.8.8 8.8.4.4


And after sudo /etc/init.d/networking restart:



ow@ubuntu002:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4
dns-nameservers 8.8.8.8 8.8.4.4


Appreciate any help with this. I can't help but try to get to the root cause of this.



EDIT:



@Simon Sudler: yes I modified /etc/network/interfaces as well as /etc/NetworkManager/NetworkManager.conf. It was based on online tutorials.



Here is the content of my interfaces file:



ow@ubuntu002:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto enp0s31f6
iface enp0s31f6 inet static
address 192.168.0.101
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8 8.8.4.4
ow@ubuntu002:~$


@oscar1919: I tried your solution and it fixed the issue!



Thank you both for your help.










share|improve this question























  • Where did you configure the static address, in /etc/network/interfaces? Can you add the entry to your question?
    – Simon Sudler
    Apr 10 at 8:58














up vote
0
down vote

favorite












Apologies if this has been answered before, I searched and couldn't find a solution.



I have setup my ubuntu 16.04 desktop with a static IP. However on startup it is not able to resolve hostnames. Surprising if I manually restart the network service with:



sudo /etc/init.d/networking restart


It fixes my DNS issue. But I have to do this every time on startup.



I think the issue is with how my resolve.conf file is being auto-written on boot.



For example on boot up it has:



ow@ubuntu002:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
dns-nameservers 8.8.8.8 8.8.4.4


And after sudo /etc/init.d/networking restart:



ow@ubuntu002:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4
dns-nameservers 8.8.8.8 8.8.4.4


Appreciate any help with this. I can't help but try to get to the root cause of this.



EDIT:



@Simon Sudler: yes I modified /etc/network/interfaces as well as /etc/NetworkManager/NetworkManager.conf. It was based on online tutorials.



Here is the content of my interfaces file:



ow@ubuntu002:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto enp0s31f6
iface enp0s31f6 inet static
address 192.168.0.101
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8 8.8.4.4
ow@ubuntu002:~$


@oscar1919: I tried your solution and it fixed the issue!



Thank you both for your help.










share|improve this question























  • Where did you configure the static address, in /etc/network/interfaces? Can you add the entry to your question?
    – Simon Sudler
    Apr 10 at 8:58












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Apologies if this has been answered before, I searched and couldn't find a solution.



I have setup my ubuntu 16.04 desktop with a static IP. However on startup it is not able to resolve hostnames. Surprising if I manually restart the network service with:



sudo /etc/init.d/networking restart


It fixes my DNS issue. But I have to do this every time on startup.



I think the issue is with how my resolve.conf file is being auto-written on boot.



For example on boot up it has:



ow@ubuntu002:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
dns-nameservers 8.8.8.8 8.8.4.4


And after sudo /etc/init.d/networking restart:



ow@ubuntu002:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4
dns-nameservers 8.8.8.8 8.8.4.4


Appreciate any help with this. I can't help but try to get to the root cause of this.



EDIT:



@Simon Sudler: yes I modified /etc/network/interfaces as well as /etc/NetworkManager/NetworkManager.conf. It was based on online tutorials.



Here is the content of my interfaces file:



ow@ubuntu002:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto enp0s31f6
iface enp0s31f6 inet static
address 192.168.0.101
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8 8.8.4.4
ow@ubuntu002:~$


@oscar1919: I tried your solution and it fixed the issue!



Thank you both for your help.










share|improve this question















Apologies if this has been answered before, I searched and couldn't find a solution.



I have setup my ubuntu 16.04 desktop with a static IP. However on startup it is not able to resolve hostnames. Surprising if I manually restart the network service with:



sudo /etc/init.d/networking restart


It fixes my DNS issue. But I have to do this every time on startup.



I think the issue is with how my resolve.conf file is being auto-written on boot.



For example on boot up it has:



ow@ubuntu002:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
dns-nameservers 8.8.8.8 8.8.4.4


And after sudo /etc/init.d/networking restart:



ow@ubuntu002:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4
dns-nameservers 8.8.8.8 8.8.4.4


Appreciate any help with this. I can't help but try to get to the root cause of this.



EDIT:



@Simon Sudler: yes I modified /etc/network/interfaces as well as /etc/NetworkManager/NetworkManager.conf. It was based on online tutorials.



Here is the content of my interfaces file:



ow@ubuntu002:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto enp0s31f6
iface enp0s31f6 inet static
address 192.168.0.101
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8 8.8.4.4
ow@ubuntu002:~$


@oscar1919: I tried your solution and it fixed the issue!



Thank you both for your help.







networking dns display-resolution






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 10 at 11:01

























asked Apr 10 at 8:49









Omer Waseem

33




33











  • Where did you configure the static address, in /etc/network/interfaces? Can you add the entry to your question?
    – Simon Sudler
    Apr 10 at 8:58
















  • Where did you configure the static address, in /etc/network/interfaces? Can you add the entry to your question?
    – Simon Sudler
    Apr 10 at 8:58















Where did you configure the static address, in /etc/network/interfaces? Can you add the entry to your question?
– Simon Sudler
Apr 10 at 8:58




Where did you configure the static address, in /etc/network/interfaces? Can you add the entry to your question?
– Simon Sudler
Apr 10 at 8:58










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










You can install a package resolvconf, which will modify the way /etc/resolv.conf is built up at system boot.
sudo apt install resolvconf

You can then create or modify a file /etc/resolvconf/resolv.conf.d/tail. If you put in this file a line nameserver 8.8.8.8, this line will be added at the end of /run/resolvconf/resolv.conf at boot. /etc/resolv.conf will now be a symbolic link to this file.

(see also here (DNS set to systemd's 127.0.0.53 - how to change permanently?)






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%2f1023576%2fissue-with-dns-resolution-in-resolve-conf-with-static-ip%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
    0
    down vote



    accepted










    You can install a package resolvconf, which will modify the way /etc/resolv.conf is built up at system boot.
    sudo apt install resolvconf

    You can then create or modify a file /etc/resolvconf/resolv.conf.d/tail. If you put in this file a line nameserver 8.8.8.8, this line will be added at the end of /run/resolvconf/resolv.conf at boot. /etc/resolv.conf will now be a symbolic link to this file.

    (see also here (DNS set to systemd's 127.0.0.53 - how to change permanently?)






    share|improve this answer
























      up vote
      0
      down vote



      accepted










      You can install a package resolvconf, which will modify the way /etc/resolv.conf is built up at system boot.
      sudo apt install resolvconf

      You can then create or modify a file /etc/resolvconf/resolv.conf.d/tail. If you put in this file a line nameserver 8.8.8.8, this line will be added at the end of /run/resolvconf/resolv.conf at boot. /etc/resolv.conf will now be a symbolic link to this file.

      (see also here (DNS set to systemd's 127.0.0.53 - how to change permanently?)






      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        You can install a package resolvconf, which will modify the way /etc/resolv.conf is built up at system boot.
        sudo apt install resolvconf

        You can then create or modify a file /etc/resolvconf/resolv.conf.d/tail. If you put in this file a line nameserver 8.8.8.8, this line will be added at the end of /run/resolvconf/resolv.conf at boot. /etc/resolv.conf will now be a symbolic link to this file.

        (see also here (DNS set to systemd's 127.0.0.53 - how to change permanently?)






        share|improve this answer












        You can install a package resolvconf, which will modify the way /etc/resolv.conf is built up at system boot.
        sudo apt install resolvconf

        You can then create or modify a file /etc/resolvconf/resolv.conf.d/tail. If you put in this file a line nameserver 8.8.8.8, this line will be added at the end of /run/resolvconf/resolv.conf at boot. /etc/resolv.conf will now be a symbolic link to this file.

        (see also here (DNS set to systemd's 127.0.0.53 - how to change permanently?)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 10 at 10:04









        oscar1919

        27215




        27215



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1023576%2fissue-with-dns-resolution-in-resolve-conf-with-static-ip%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491