What configuration is correct for Static IP?

First, yes, this question's "question" will be an exact duplicate of static ip - what am I doing wrong? , but the question was never resolved in a way that helps.

What I am trying to do is make my Ubuntu Server have a static IP address. I am not entirely sure on the numbers to plug in, but I am sure it has something to do with correctly setting up the DNS servers.

Information I have:

  • I want the address of the computer to be 192.168.1.99.
  • The router's address is 192.168.1.1.
  • The subnet mask is 255.255.255.0.
  • I assume that the network is 192.168.1.0.
  • I assume that the broadcast is 192.168.1.255.
  • According to my router, the DNS servers are 75.75.75.75 and 75.75.75.76. No idea if this is correct or not.

This is what my files look like currently:

/etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.1.99
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

/etc/resolv.conf

#these are all commented out, I was trying ideas, but no combinations worked.
#nameserver 75.75.75.75
#nameserver 75.75.76.76
#nameserver 8.8.8.8
#search hsd1.nh.comcast.net

Currently, as with the similar question, I can ping every other computer on my local network. But as soon as I try to ping , I get unknown host .

If anyone has any suggestions, it would help a lot.

suggestion: Why doesn't this custom static IP network configuration work? (the first comment)

6

2 Answers

Ok, I am not sure why, but I got it to work. I am not going to mark it as the answer until I am conviced that I solved the issue.

First what I did was go to this tutorial, and noticed that they have search cyberciti.biz in their /etc/resolv.conf file, followed by the dns servers they want to use. Remembering that this "search" line is similar to the one that was automatically generated in my copy of the file, I formatted the file to look like this:

search hsd1.nh.comcast.net
nameserver 68.87.71.226
nameserver 68.87.73.242

These DNS number I had to get from this website (I use comcast).

I restarted the computer and magicly I can ping Google! Also, the search line has been removed from the /etc/resolv.conf file, but I think that's ok.

Also, I don't know if this helps/hurts, but I put in the line

dns-nameservers 68.87.71.226 68.87.73.242

in my /etc/network/interfaces file, as the last line.

I will update this post if this turns out to work or not.

3

Do you have a local DNS server in your LAN?

If not, try to put Google DNS or Open DNS in your /etc/resolv.conf.

Google DNS is: 8.8.8.8 and 8.8.4.4
Open DNS is: 208.67.222.222 and 208.67.220.220

The syntax is:

nameserver 8.8.8.8
nameserver 8.8.4.4

Also maybe you need to restart networking after that, but I am not sure:

sudo /etc/init.d/networking restart

On Windows you would flush the DNS cache, but Ubuntu doesn't cache DNS by default I think.

6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like