Static IP and DNS

General support questions including new installations
Post Reply
arya6000
Posts: 14
Joined: 2007/01/28 00:11:29

Static IP and DNS

Post by arya6000 » 2007/04/14 20:53:37

Hello

I installed CentOS 5 today, and I selected DHCP for my IP Address, than when installation was over, I typed in

[code]setup[/code]

and selected "Network Configuration"

I checked off DHCP and filled in the following information:

Static IP: 192.168.15.10
Netmask: 255.255.255.0
Gateway IP: 192.168.15.1

After I reboot I can ssh to the box but anything that has to deal with DNS doesn't work, like if I type in

[code]yum update[/code] It says that the mirror list can't be reached, cause the name can't be resolved


Anyway to fix this?



Thank You

arya6000
Posts: 14
Joined: 2007/01/28 00:11:29

Re: Static IP and DNS

Post by arya6000 » 2007/04/15 04:34:53

The exaxt massage that it gives is: "temporary failure in name resolution"

I tried installing CentOS 5 on another machine and its the same thing on that.

I used static IPs on CentOS 4.4 and they worked perfectly

Can this be a bug?

dkilgo
Posts: 5
Joined: 2005/01/17 11:11:01
Location: USA, Texas

Static IP and DNS

Post by dkilgo » 2007/04/16 18:02:09

Try adding your dns server ip to /etc/resolv.conf
It's just server name [space] ip address.

Mine looks like:
[code]nameserver 192.168.0.1[/code]

[url=http://www.faqs.org/docs/securing/chap9sec91.html]info about resolv.conf[/url]

NedSlider
Forum Moderator
Posts: 2897
Joined: 2005/10/28 13:11:50
Location: UK

Re: Static IP and DNS

Post by NedSlider » 2007/04/16 18:35:01

I ran into a similar issue manually configuring my network during installation. It seems it failed to take my gateway settings as no route to the gateway was added (thus meaning that you'll never reach your dns servers, but will be able to ping internally on your lan).

As root, do:

[code]route[/code]

and see if your gateway is set correctly. If not, again from the terminal I set mine as follows:

[code]route add default gw 192.168.0.1[/code]

You should get something like this:

[code]
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[/code]

Hope that helps

Ned

Post Reply