[SOLVED] Can't resolve *any* hostnames.

Issues related to configuring your network
Post Reply
MWade
Posts: 5
Joined: 2012/06/16 21:44:08
Contact:

[SOLVED] Can't resolve *any* hostnames.

Post by MWade » 2012/06/16 21:49:05

Hello,

Recently I have been having a problem with what I'm guessing is my DNS configuration.

I have a CentOS server running whm/cpanel and have not had this problem before.

when I try to ping google.com I get this from tcpdump:
15:58:03.154267 IP 46.249.48.97.53536 > 8.8.8.8.domain: 10474+ A? google.com. (28)


resolv.conf:
search 2006scape.com
nameserver 8.8.8.8
nameserver 8.8.4.4

/etc/hosts:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
46.249.48.97 server.2006scape.com server


route -n:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
46.249.48.0 0.0.0.0 255.255.255.0 U 0 0 0 em1
0.0.0.0 46.249.48.1 0.0.0.0 UG 0 0 0 em1


I can ping all IP addresses fine.
I can ping hostname.domain.com.
I am unable to use dig or any other commands like nslookup (they all say failed to connect)

Anything that requires resolve an domain name (updating csf firewall, and so on), fails to do anything.

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can't resolve *any* hostnames.

Post by TrevorH » 2012/06/16 22:12:16

Sounds like you have either lost external connectivity (missing route?) or you've firewalled off either outbound or inbound UDP port 53 traffic. Can you ping 8.8.8.8? If you can then the connectivity is OK but your DNS lookups are failing and these are done using UDP port 53 (and the same port on TCP for longer responses). Check your firewall rules.

MWade
Posts: 5
Joined: 2012/06/16 21:44:08
Contact:

Re: Can't resolve *any* hostnames.

Post by MWade » 2012/06/16 23:31:17

I can ping 8.8.8.8 as well as any other IP addresses. I have disabled my firewall and checked the rules for allowing port 53 udp in/out but to no avail. People are able to connect to my website without any problem at all, and I can use all services like ssh, ftp, scp, and so on.

I had a route where the IP was like 169.254.*.* before and with that it wasn't working. I have tried contacting my host but they're dutch so you know how that goes.

I have disabled my firewall and this is the result I get when trying to ping google:
18:33:40.274573 IP 46.249.48.97.51789 > 8.8.4.4.domain: 1035+ A? google.com. (28)
18:33:45.279604 IP 46.249.48.97.40942 > 8.8.8.8.domain: 1035+ A? google.com. (28)

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Can't resolve *any* hostnames.

Post by jlehtone » 2012/06/17 12:32:58

I'd guess it is your dutch ISP that blocks udp:53. They must have their own DNS-server that you are supposed to use instead of 8.8.8.8.

MWade
Posts: 5
Joined: 2012/06/16 21:44:08
Contact:

Re: Can't resolve *any* hostnames.

Post by MWade » 2012/06/18 01:10:37

For anyone interested this was my problem:

Before:
root@server [/var/log]# cat /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE="em1"
BOOTPROTO="static"
DNS1="127.0.0.1"
GATEWAY="some_ip"
HWADDR="hwid"
IPADDR="some_ip"
IPV6INIT="yes"
NETMASK="255.255.255.0"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"

After:
root@server [/var/log]# cat /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE="em1"
BOOTPROTO="static"
DNS1="127.0.0.1"
DNS2="8.8.8.8"
DNS3="8.8.4.4"
GATEWAY="some_ip"
HWADDR="hwid"
IPADDR="some_ip"
IPV6INIT="yes"
NETMASK="255.255.255.0"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"

all is working now :-D

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

[SOLVED] Can't resolve *any* hostnames.

Post by pschaff » 2012/06/18 15:42:38

Thanks for reporting back. Marking this thread [SOLVED] for posterity.

Post Reply