I have a quite common problem except all the solutions I've found didn't work for me.
I had my VPS, running Debian 5/Debian 6/CentOS 5.5/whatever-else-OS-I've-tried, rebuilt and reinstalled. Once started, the network works fine, and I can ping IPs,
184.108.40.206 for example. The problem here is that the VPS can't resolve hostnames.
First of all, the default
resolv.conf looks fine:
vps:~# cat /etc/resolv.conf nameserver 220.127.116.11 nameserver 18.104.22.168
Those hosts are set by default by my VPS provider. The file does not get rewrited. And the default version is restored on every reboot.
22.214.171.124 server works, I've tried it on my home PC. As well as I've tried my home ISP's DNS server on that VPS -- still no success.
As I've already said, ping works fine as well:
vps:~# ping -c 4 126.96.36.199 PING 188.8.131.52 (184.108.40.206) 56(84) bytes of data. 64 bytes from 220.127.116.11: icmp_seq=1 ttl=55 time=7.63 ms 64 bytes from 18.104.22.168: icmp_seq=2 ttl=55 time=7.55 ms 64 bytes from 22.214.171.124: icmp_seq=3 ttl=55 time=7.08 ms 64 bytes from 126.96.36.199: icmp_seq=4 ttl=55 time=7.30 ms
Here's what the
/etc/hosts file looks like:
vps:~# cat /etc/hosts ::1 localhost.localdomain localhost 127.0.0.1 localhost.localdomain localhost # Auto-generated hostname. Please do not remove this comment. *my-actual-IP-goes-here* example.com vps
UPDATE The contents of
vps:~# cat /etc/nsswitch.conf passwd: compat group: compat shadow: compat hosts: files dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis
/etc/network/interfaces file has the 100% working backed up version of config, and I can see that in the
ifconfig output. The
/ver/log/syslog file doesn't say anything relevant, except the
sm-mta: gethostbyaddr(my-actual-IP-goes-here) failed: 2
bind is installed:
vps:~# apt-cache policy bind9 bind9: Installed: 1:9.5.1.dfsg.P3-1+lenny1 Candidate: 1:9.5.1.dfsg.P3-1+lenny1 Version table: *** 1:9.5.1.dfsg.P3-1+lenny1 0 100 /var/lib/dpkg/status