Results 1 to 5 of 5

Thread: Switched to Static IP on my server and now can't find nameserver

  1. #1
    Join Date
    Sep 2006
    Location
    Maryland, USA
    Beans
    255
    Distro
    Ubuntu 12.04 Precise Pangolin

    Switched to Static IP on my server and now can't find nameserver

    I have several machines in my network and two servers. The second server, I just loaded up with Ubuntu 12.10 server edition. I wanted to change it to a static IP address. I updated the /etc/network/interfaces file to read

    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
    
    # The primary network interface
    auto wlan0
    iface wlan0 inet static
            address 192.168.1.101
            netmask 255.255.255.0
            network 192.168.1.0
            broadcast 192.168.1.255
            gateway 192.168.1.1
            wpa-ssid mywpaname
            wpa-psk  mysupersecretpassword
    Everything seems to work EXCEPT for dns names. For example, I can get the IP address for google.com and ping it. However, I cannot run ping google.com - just get an unknown host error.

    I've tried adding nameserver 8.8.8.8 to the interfaces file - but that didn't work. I've looked at the resolv.conf file, but it tells me not to modify it.

    What should I be doing here?

    Thanks
    Impari Systems, Inc
    http://www.imparisystems.com

  2. #2
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,660
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Switched to Static IP on my server and now can't find nameserver

    I can't find anything exact on google right now, but try 'nameservers'.

    I think in /etc/resolv.conf (which now you shouldn't edit manually) it was used 'nameserver' and different servers are in different lines, but in /etc/network/interfaces with an S at the end, and the different servers are separated by a space. Try:
    nameservers 8.8.8.8

    You can also drop the network and broadcast options, they are calculated automatically. But it doesn't matter if they stay there.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  3. #3
    Join Date
    Apr 2012
    Beans
    5,471

    Re: Switched to Static IP on my server and now can't find nameserver

    it's dns-nameservers I think e.g.

    Code:
    auto wlan0
    iface wlan0 inet static
            address 192.168.1.101
            netmask 255.255.255.0
            network 192.168.1.0
            broadcast 192.168.1.255
            gateway 192.168.1.1
            wpa-ssid mywpaname
            wpa-psk  mysupersecretpassword
            dns-nameservers 8.8.8.8 8.8.4.4
    http://manpages.ubuntu.com/manpages/...olvconf.8.html

  4. #4
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,660
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Switched to Static IP on my server and now can't find nameserver

    Spot on.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  5. #5
    Join Date
    Sep 2006
    Location
    Maryland, USA
    Beans
    255
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Switched to Static IP on my server and now can't find nameserver

    That worked! Thanks!
    Impari Systems, Inc
    http://www.imparisystems.com

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
  •