Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Problem with name resolution and static IP address

  1. #1
    Join Date
    Feb 2016
    Beans
    24

    Question Problem with name resolution and static IP address

    Hello Colleagues,

    I want to configure static IP address from DHCP I am using right now.

    Here is config of my /etc/network/interfaces

    Code:
     auto lo
     iface lo inet loopback
     auto eth0
     iface eth0 inet static
     address 192.168.200.107
     netmask 255.255.255.0
     gateway 192.168.200.254
     dns-nameserver 192.168.200.254
    And here is my /etc/NetworkManager/NetworkManager.conf

    Code:
    [main]
    plugins=ifupdown,keyfile,ofono
    #dns=dnsmasq
    [ifupdown]
    managed=true
    When I implemented those changes I don't have working name resolution / dns.

    My resolv.conf is empty.

    What am I doing wrong here?
    Last edited by Wojciech_Marusiak; March 3rd, 2016 at 09:59 PM.

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Problem with name resolution and static IP address

    Hi Wojciech_Marusiak.

    First, fix the interfaces file. It is dns-nameservers, with an s at the end:
    Code:
    ...
     dns-nameservers 192.168.200.254
    ...
    Then make sure your resolv.conf is a symlink to the proper file:
    Code:
    $ ls -l /etc/resolv.conf
    lrwxrwxrwx 1 root root 29 Mar 26  2015 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
    If it is not, remove it and create the symlink:
    Code:
    sudo rm /etc/resolv.conf
    
    sudo ln -s ../run/resolvconf/resolv.conf /etc/resolv.conf
    Restar your machine, and let us know how that went.

    Regards.

  3. #3
    Join Date
    Feb 2016
    Beans
    24

    Re: Problem with name resolution and static IP address

    Hi papibe,

    I corrected typo. After reboot name resolution is still not working.

    I have correct link to file:

    Code:
    root@ZBOX:~# ls -l /etc/resolv.conf
    lrwxrwxrwx 1 root root 29 lip 15  2014 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
    Last edited by Wojciech_Marusiak; March 3rd, 2016 at 10:39 PM.

  4. #4
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Problem with name resolution and static IP address

    Is the machine not able to resolve google.com, and such?

    or

    other machines are not able to resolve that machine's name?

    Could you open a terminal, run these commands and post back the results? (you can copy/paste the output):
    Code:
    cat /etc/resolv.conf 
    
    ifconfig
    
    nm-tool
    
    nslookup google.com
    
    dig ubuntuforums.org
    
    route -n
    
    ping 192.168.200.254
    
    ping 199.19.56.1
    Please note that if network-manager is installed, it overrides what you do on /etc/network/interfaces. You can easily set up the same static data in network-manager by using the GUI tool 'Network Connections'.

    Regards.

  5. #5
    Join Date
    Feb 2008
    Location
    Land of fire and drought
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: Problem with name resolution and static IP address

    If you tweak with the /interfaces file it will screw with Network Manager if you are using. Generally, you don't need to do any of what you are doing to create a static IP. I've never done it and statics are all I use.

    Click Network Manager> Edit> Choose the connection and 'Edit'> IPv4 tab> change 'Automatic' to 'Manual' and put in the details for your static IP, gateway, DNS IPs, etc.

    If your router is serving IPs DHCP, you need to set it to serve them in a certain range only, say 192.168.0.100-110. You would then set the static outside of that, say 192.168.0.111 and above (or below .99 and below).

    Your /interfaces file should look like this:

    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    If you're using Network Manager for your connection, the moment you start changing the /interfaces file, expect trouble. They don't play together.

  6. #6
    Join Date
    Apr 2012
    Beans
    Hidden!

    Re: Problem with name resolution and static IP address

    Hi, if you choose to use NetworkManager to manage your network then please do..
    to help avoid typo's please copy and paste.
    To save your current /etc/network/interfaces file
    Code:
    sudo cp /etc/network/interfaces /etc/network/interfaces.old
    Or to delete it..
    Code:
    sudo rm /etc/network/interfaces
    Then to build it for NetworkManager use..
    Code:
    echo "auto lo\niface lo inet loopback" | sudo tee /etc/network/interfaces
    Next to configure your network IPv4 and IPv6 settings click the 'Network icon' then 'Edit Connections' and configure like the attached.
    Screenshot from 2016-03-03 21:40:36.pngScreenshot from 2016-03-03 21:41:24.png
    Finally change /etc/NetworkManager/NetworkManager.conf from true to false
    Code:
    sudo sed -i 's/true/false/' /etc/NetworkManager/NetworkManager.conf
    reboot and test wireless
    Craving anchovy, herring and squid pizza.....with clam sauce

  7. #7
    Join Date
    Feb 2016
    Beans
    24

    Re: Problem with name resolution and static IP address

    In reply to papibe

    Hi,

    Code:
    root@ZBOX:~# 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
    ifconfig
    Code:
    root@ZBOX:~# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:01:2e:56:2f:56
              inet addr:192.168.200.107  Bcast:192.168.200.255  Mask:255.255.255.0
              inet6 addr: fe80::201:2eff:fe56:2f56/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:1354 errors:0 dropped:0 overruns:0 frame:0
              TX packets:347 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:108175 (108.1 KB)  TX bytes:55220 (55.2 KB)
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:2412 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2412 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:216313 (216.3 KB)  TX bytes:216313 (216.3 KB)
    nm-tool
    Code:
    root@ZBOX:~# nm-tool
    No command 'nm-tool' found, did you mean:
     Command 'dm-tool' from package 'lightdm' (main)
    nm-tool: command not found
    nslookup google.com
    Code:
    root@ZBOX:~# nslookup google.com
    ;; connection timed out; no servers could be reached
    dig ubuntuforums.org
    Code:
    root@ZBOX:~# dig ubuntuforums.org
    ; <<>> DiG 9.9.5-11ubuntu1.2-Ubuntu <<>> ubuntuforums.org
    ;; global options: +cmd
    ;; connection timed out; no servers could be reached
    route -n
    Code:
    root@ZBOX:~# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.200.254 0.0.0.0         UG    100    0        0 eth0
    169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
    192.168.200.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
    ping 192.168.200.254
    Code:
    root@ZBOX:~# ping 192.168.200.254
    PING 192.168.200.254 (192.168.200.254) 56(84) bytes of data.
    64 bytes from 192.168.200.254: icmp_seq=1 ttl=64 time=0.288 ms
    64 bytes from 192.168.200.254: icmp_seq=2 ttl=64 time=0.241 ms
    ^C
    --- 192.168.200.254 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1001ms
    rtt min/avg/max/mdev = 0.241/0.264/0.288/0.028 ms
    ping 199.19.56.1
    Code:
    root@ZBOX:~# ping 199.19.56.1
    PING 199.19.56.1 (199.19.56.1) 56(84) bytes of data.
    64 bytes from 199.19.56.1: icmp_seq=1 ttl=53 time=118 ms
    64 bytes from 199.19.56.1: icmp_seq=2 ttl=53 time=117 ms
    64 bytes from 199.19.56.1: icmp_seq=3 ttl=53 time=151 ms
    ^C
    --- 199.19.56.1 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2001ms
    rtt min/avg/max/mdev = 117.121/129.214/151.938/16.084 ms


    In reply to Bucky Ball

    I am not using Network Manager and I don't want to use it.

    About DHCP range you are not entirely true. I can have static on my box from DHCP range. If DHCP client will receive lease from same IP as my box then both boxes will have problems. So far it is not the case.

    In reply to Hadaka

    I don't want to use Network Manager.
    Last edited by Wojciech_Marusiak; March 4th, 2016 at 01:59 PM. Reason: posts combined.

  8. #8
    Join Date
    Feb 2008
    Location
    Land of fire and drought
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: Problem with name resolution and static IP address

    Quote Originally Posted by Wojciech_Marusiak View Post
    About DHCP range you are not entirely true. I can have static on my box from DHCP range. If DHCP client will receive lease from same IP as my box then both boxes will have problems. So far it is not the case.
    Good idea to guarantee it never is, but leave it with you.

    Good luck.

  9. #9
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Problem with name resolution and static IP address

    Thanks.

    It looks like the problem is that the name server is not getting written on 'resolv.conf'. Lately, that job is now done by the resolvconf package.

    Try reconfiguring the package, and then force it to update the resolv.conf:
    Code:
    sudo dpkg-reconfigure resolvconf
    
    sudo resolvconf -u
    Hope it helps. Let us know how it goes.
    Regards.

  10. #10
    Join Date
    Feb 2016
    Beans
    24

    Re: Problem with name resolution and static IP address

    Quote Originally Posted by papibe View Post
    Thanks.

    It looks like the problem is that the name server is not getting written on 'resolv.conf'. Lately, that job is now done by the resolvconf package.

    Try reconfiguring the package, and then force it to update the resolv.conf:
    Code:
    sudo dpkg-reconfigure resolvconf
    
    sudo resolvconf -u
    Hope it helps. Let us know how it goes.
    Regards.
    Hi papibe,

    I tried your solution and it didn't work

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •