Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I changed my IP to static IP and I no more have access to the internet on my CENTOS 5 server. Oddly you can see the webpage that I am hosting on the server if you navigate to it from another computer but you cannot go on the internet from the CENTOS computer itself, i.e. you cannot navigate to any website from a browser (Firefox, IE, etc) on the centos machine. It was working before until we changed the IP and sent the website we are hosting on the server live. Any answers will be greatly appreciated.

share|improve this question
Check your gateway and dns settings. – user17642 Sep 9 '09 at 19:08
up vote 0 down vote accepted

Please setup your dns servers :

echo "nameserver x.x.x.x" > /etc/resolv.conf
echo "nameserver y.y.y.y" >> /etc/resolv.conf

And set you default gateway by this command line:

route add default gw z.z.z.z

share|improve this answer

Can you list the output of:

netstat -rn
cat /etc/resolv.conf
share|improve this answer

check your IPTABLES (iptables -L) and look for drop rules in the output field.

Also check and make sure that there isn't a network manager conflict, like the service network and NetworkManager are not both running.

share|improve this answer

You lost your DNS providers when you switched to a static IP. The easiest way to get DNS back working is to do this as a superuser:

echo >> /etc/resolv.conf
share|improve this answer
Technically, it would be: echo "nameserver" >> /etc/resolv.conf Also, using a nameserver from another ISP is bad netiquette (even if they've left it wide open). You would be better off contacting your own ISP and ask them what are their name server IP addresses are. – Sean Staats Sep 9 '09 at 20:05
I agree that this is probably the answer to the problem. As Sean Staats mentions, you will want to find the proper DNS servers for your ISP, or use OpenDNS (depending on your philosophy on OpenDNS). – Joe Sep 9 '09 at 21:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.