Search This Blog

Friday, December 11, 2009

Host name lookup failure

ping: cannot resolve google.com: Host name lookup failure

When you put a host (a computer) behind a router, you might suddenly get a "host name lookup failure" even though your network was working a moment ago. You are pretty sure your network is up, your nameserver is working, and you can usually fix it by restarting the host.

You can fix this without restarting a host. The problem is very likely that your host does not use your new router as a default gateway. you simply need to add that as your default route using:

route add default 192.168.1.1

assuming 192.168.1.1 is the router.
you might want to flush the route using route flush

Read the interesting FreeBSD handbook here

More:
check your routing tables with
netstat -r
renew your dhcp lease with
dhclient 192.168.1.100
re-enable your (network) interface with
ifconfig interface up
ifconfig interface down
check your nameserver at
/etc/resolv.conf

No comments: