# Couldn't resolve host and DNS Resolution failed



## rocco27 (Feb 19, 2012)

Hi all!

I'm new here. I tried to find a resolution to my problem, but without any success yet.

I'm using FreeBSD 7.2-RELEASE AMD64, we have changed operation system from 32-bit to 64-bit. I'm running Call of Duty 4 and PunkBuster on this system and now I got 'Couldn't resolve host' and 'DNS Resolution failed' problems.

Error from Game Server:

```
Attempting to resolve cod4.masterserver.com
Couldn't resolve host
```

I'm not sure 100% about the error message, but it was something like that. I could not ping the domain, but I could the IP. After that I could change the domain name to IP address in the game file, and the problem was solved. But not in a nice way.

Not nice, because *I* have the same problem with PunkBuster and *I* can not fix it the same way.

Installing PunkBuster:

```
Resolving update servers...
Downloading a new global config file...
 **ERROR: Downloading a global config file failed for the following reason:

Couldn't resolve host 'websec2.evenbalance.com'
```

Before it worked, *I* could install, don't know why, but worked wrong:

```
PunkBuster Server: Attempting to resolve master8.evenbalance.com
PunkBuster Server: DNS Resolution failed: using 0 cached hostnamed resolutions
```

Maybe the problem with DNS, nameserver or what? I can show some configurations if it's important. I'm still looking on the forums, but if someone has an idea what's wrong in my system, *I* will be glad. 

Thanks


----------



## J65nko (Feb 19, 2012)

You can use [cmd=]dig[/cmd] to do DNS lookups from the command line:


```
[cmd=$] dig master8.evenbalance.com[/cmd]

; <<>> DiG 9.4.2-P2 <<>> master8.evenbalance.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56559
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;master8.evenbalance.com.       IN      A

;; ANSWER SECTION:
[color=blue]master8.evenbalance.com. 1800   IN      A       66.180.170.20[/color]

;; Query time: 200 msec
;; [color=blue]SERVER: 192.168.222.10#53[/color](192.168.222.10)
;; WHEN: Sun Feb 19 21:31:27 2012
;; MSG SIZE  rcvd: 57
```
In my case the answer is given by my local (caching) nameserver at 192.168.222.10.
The dig program consults /etc/resolv.conf to decide which nameservers to use

```
[cmd=$]cat /etc/resolv.conf[/cmd]
domain  utp.xnet
nameserver      192.168.222.10
```
Here there is only one nameserver entry but there also could be multiple entries.

In order to help you, please post the output of [cmd=]dig cod4.masterserver.com[/cmd] and the contents of the files /etc/resolv.conf and /etc/nsswitch.conf


----------



## rocco27 (Feb 20, 2012)

```
dig cod4master.activision.com

; <<>> DiG 9.4.3-P2 <<>> cod4master.activision.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64746
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;cod4master.activision.com.     IN      A

;; ANSWER SECTION:
cod4master.activision.com. 22   IN      A       63.146.124.21

;; Query time: 18 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Mon Feb 20 08:10:44 2012
;; MSG SIZE  rcvd: 59
```


```
dig websec2.evenbalance.com

; <<>> DiG 9.4.3-P2 <<>> websec2.evenbalance.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63307
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;websec2.evenbalance.com.       IN      A

;; ANSWER SECTION:
websec2.evenbalance.com. 1800   IN      A       74.208.184.102

;; Query time: 1409 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Mon Feb 20 08:12:40 2012
;; MSG SIZE  rcvd: 57
```


```
dig master8.evenbalance.com

; <<>> DiG 9.4.3-P2 <<>> master8.evenbalance.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19664
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;master8.evenbalance.com.       IN      A

;; ANSWER SECTION:
master8.evenbalance.com. 35     IN      A       66.180.170.20

;; Query time: 17 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Mon Feb 20 08:13:25 2012
;; MSG SIZE  rcvd: 57
```

resolv.conf

```
nameserver 127.0.0.1
nameserver 8.8.4.4
```

nsswitch.conf

```
#
# nsswitch.conf(5) - name service switch configuration file
# $FreeBSD: src/etc/nsswitch.conf,v 1.1.8.1 2009/04/15 03:14:26 kensmith Exp $
#
group: compat
group_compat: nis
hosts:	files dns
networks: files
passwd: compat
passwd_compat: nis
shells: files
services: compat
services_compat: nis
protocols: files
rpc: files
```

Thanks for help!


----------



## rocco27 (Feb 20, 2012)

Ok, I removed 
	
	



```
nameserver 127.0.0.1
```
 from the resolv.conf and *I* could install PunkBuster. Server could resolve host 'websec2.evenbalance.com'. I have to upload some files and continue test it.


----------



## rocco27 (Feb 22, 2012)

Ok, I still have problem with resolving...:\


----------



## razrx (Feb 22, 2012)

rocco27 said:
			
		

> Ok, I still have problem with resolving...:\



How is IP assignment handled?
Are you using DHCP ?
Is 127.0.0.1 back into your /etc/resolv.conf since your last post?
Is your FreeBSD box running a nameserver such as named? (look for named_enable="YES" in /etc/rc.conf).

It strikes me that in all the dig(1)() examples you've shown the nameserver answering the dns queries is actually the 8.4.4.4 host and not 127.0.0.1. Please show us dig(1)() output when your queries are actually failing (probably due to a misconfigured local named instance).


----------



## rocco27 (Mar 6, 2012)

```
resm2# dig cod4.masterserver.com

; <<>> DiG 9.4.3-P2 <<>> cod4.masterserver.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21573
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;cod4.masterserver.com. IN A

;; ANSWER SECTION:
cod4.masterserver.com. 3323 IN CNAME masterserver.com.
masterserver.com. 3323 IN A 66.254.108.157

;; Query time: 18 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Tue Mar 6 20:48:15 2012
;; MSG SIZE rcvd: 69
```


```
resm2# dig

; <<>> DiG 9.4.3-P2 <<>>
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28666
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;. IN NS

;; ANSWER SECTION:
. 4984 IN NS m.root-servers.net.
. 4984 IN NS i.root-servers.net.
. 4984 IN NS f.root-servers.net.
. 4984 IN NS k.root-servers.net.
. 4984 IN NS l.root-servers.net.
. 4984 IN NS a.root-servers.net.
. 4984 IN NS g.root-servers.net.
. 4984 IN NS e.root-servers.net.
. 4984 IN NS c.root-servers.net.
. 4984 IN NS d.root-servers.net.
. 4984 IN NS b.root-servers.net.
. 4984 IN NS h.root-servers.net.
. 4984 IN NS j.root-servers.net.

;; Query time: 17 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Tue Mar 6 20:48:34 2012
;; MSG SIZE rcvd: 228
```


```
resm2# fetch cod4.masterserver.com
cod4.masterserver.com 100% of 16 kB 63 MBps
```

/etc/rc.conf has named enabed

resolv.conf

```
domain resm2.eu
nameserver 8.8.4.4
```


----------



## rocco27 (Jul 9, 2012)

I could fix the resolving problem, I added IP and DNS to the usr/etc/hosts

```
63.146.124.21 cod4master.activision.com
66.36.231.175 master1.evenbalance.com
204.15.228.214 master2.evenbalance.com
216.240.146.139 master3.evenbalance.com
66.180.170.20 master4.evenbalance.com
66.36.231.175 master5.evenbalance.com
204.15.228.214 master6.evenbalance.com
216.240.146.139 master7.evenbalance.com
66.180.170.20 master8.evenbalance.com
```


----------



## SirDice (Jul 10, 2012)

Keep in mind 7.2 is End-of-Life, plan an upgrade to 7.4.


----------

