Results 1 to 3 of 3

Thread: How to set DNS for static server

  1. #1
    Join Date
    Aug 2010
    Location
    America
    Beans
    82
    Distro
    Ubuntu 10.04 Lucid Lynx

    How to set DNS for static server

    I'm sorry if this has already been over im sure it has but about after an hour of searching I'm still stuck. Anyway,

    I have a Ubuntu server running that i want to keep set static. What i don't know is how to obtain my DNS server IP address and where to put it? in the/etc/network/interfaces file?


    Code:
    auto lo
    iface lo inet loopback
    
    
    auto eth0
    iface eth0 inet static
    
    
    address 192.168.1.5
    netmask 255.255.255.0
    gateway 192.168.1.1

    This is what i have and it works fine on my LAN. I just need it to get to the internet too!

    Any help?

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,697
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to set DNS for static server

    Hi JD32.

    Try this:
    Code:
    auto lo
    iface lo inet loopback
    
    auto eth0
    
    iface eth0 inet static
      address 192.168.1.5
      netmask 255.255.255.0
      gateway 192.168.1.1
      dns-nameservers 192.168.1.1
    Replace 192.168.1.1 with another address if your router does not work as DNS. For instance OpenDNS' 208.67.222.222, or Google's 8.8.8.8

    You need to restart the networking stack to take effect:
    Code:
    sudo service networking restart
    Hope it helps. Let us know how it goes.
    Regards.
    Last edited by papibe; July 9th, 2013 at 12:24 AM. Reason: added restart.

  3. #3
    Join Date
    Aug 2010
    Location
    America
    Beans
    82
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to set DNS for static server

    That did the trick, I should have known that!

    But thanks anyhow!

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
  •