Saturday, May 18, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2106  / 2 Years ago, sat, april 16, 2022, 11:35:26

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 www.google.com, I get unknown host www.google.com.



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



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


More From » server

 Answers
1

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.


[#36358] Monday, April 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fotres

Total Points: 35
Total Questions: 124
Total Answers: 112

Location: Federated States of Micronesia
Member since Sat, Jun 4, 2022
2 Years ago
;