# Why my DNS resolution doesn't work on VirtualHost ?



## cleroy61 (Jun 30, 2011)

Hi everybody,

I haven't got my DNS resolution with the virtual host? I think I forgot something, don't I?

Error message:

[cmd=]nslookup www.discoverdigitalmarketingtips.com[/cmd]

```
Server:         95.130.12.1
Address:        95.130.12.1#53

** server can't find www.discoverdigitalmarketingtips.com: NXDOMAIN
```

I rent a dedicated server, I configured domain name like this:


```
Zones (Domaines) takinium.com.
	MX	mail	10	[Supprimer]

	NS	ns1.digicube.fr.		

	NS	ns2.digicube.fr.		

www	A	95.130.12.68		[Supprimer]

www	CNAME	discoverdigitalmarketingtips.com		[Supprimer]

www	CNAME	takinium.com.		[Supprimer]
```

I bought a domain name from Gandi, takinium.com, and I configured DNS zone like this:


```
ftp 28800 IN A 95.130.12.68
www 3600 IN A 95.130.12.68
@ 3600 IN A 95.130.12.68
```

I installed Famp, oscommerce, phpMyAdmin, Wordpress, AWstats in the /usr/local/www folder with a symbolic link to /usr/local/www/apache22/data:

www.takinium.com/wordpress/
www.takinium.com/phpMyadmin/

etc ...

I want to put another domain name on the same dedicated server, so I bought another domain name discoverdigitalmarketingtips.com from Gandi and I configured the same DNS zone like this:


```
ftp 28800 IN A 95.130.12.68
www 3600 IN A 95.130.12.68
@ 3600 IN A 95.130.12.68
```

1 - I added in this file : 
[cmd=]ee /etc/rc.conf[/cmd]


```
ifconfig_re0_alias0="192.168.1.10 netmask 255.255.255.255"
```

2 - I added in this file : 
[cmd=]ee /usr/local/etc/apache22/httpd.conf[/cmd]


```
Listen 8080
Listen 192.168.1.10:8080

ServerName www.takinium.com:80
ServerName www.discoverdigitalmarketingtips.com:8080

# Virtual hosts
Include etc/apache22/extra/httpd-vhosts.conf
```

3 - I added in this file : 
[cmd=]ee /etc/hosts[/cmd]


```
127.0.0.1               www.takinium.com        takinium.com
127.0.0.1               www.discoverdigitalmarketingtips.com    discoverdigitalmarketingtips.com
```

4 - I added in this file :
[cmd=]ee /usr/local/etc/apache22/Includes/discoverdigitalmarketingtips.com.conf[/cmd]


```
ServerName www.discoverdigitalmarketingtips.com

NameVirtualHost 192.168.1.10:8080

# Name VirtualHost 192.168.1.10:8080
<VirtualHost 192.168.1.10:8080>
ServerAdmin webmaster@discoverdigitalmarketingtips.com
DocumentRoot /usr/local/www/discoverdigitalmarketingtips/
ServerName www.discoverdigitalmarketingtips.com
ServerAlias discoverdigitalmarketingtips.com *.discoverdigitalmarketingtips.com
ErrorLog /var/log/http/discoverdigitalmarketingtips.com-error_log
CustomLog /var/log/http/discoverdigitalmarketingtips.com-access_log combined
</VirtualHost>
```
5 - I created a folder and index.html.

[cmd=]mkdir /usr/local/www/discoverdigitalmarketingtips[/cmd]
[cmd=]cp /tmp/index.html /usr/local/www/discoverdigitalmarketingtips/[/cmd]

[cmd=]#/usr/local/etc/rc.d/apache22 start[/cmd]

```
Syntax Ok
starting apache22
```
[cmd=]#httpd -S[/cmd]

```
VirtualHost configuration:
192.168.1.10:8080      is a NameVirtualHost
         default server www.discoverdigitalmarketingtips.com (/usr/local/etc/apache22/Includes/discoverdigitalmarketingtips.com.conf:7)
         port 8080 namevhost www.discoverdigitalmarketingtips.com (/usr/local/etc/apache22/Includes/discoverdigitalmarketingtips.com.conf:7)
wildcard NameVirtualHosts and _default_ servers:
_default_:443          www.takinium.com/ (/usr/local/etc/apache22/extra/httpd-ssl.conf:74)
Syntax OK
```

[cmd=]sockstat -4 | grep 192.168.1.10[/cmd]

```
www      httpd      1686  6  tcp4   192.168.1.10:8080     *:*
www      httpd      1686  7  tcp4   192.168.1.10:443      *:*
www      httpd      1685  6  tcp4   192.168.1.10:8080     *:*
www      httpd      1685  7  tcp4   192.168.1.10:443      *:*
www      httpd      1684  6  tcp4   192.168.1.10:8080     *:*
www      httpd      1684  7  tcp4   192.168.1.10:443      *:*
www      httpd      1683  6  tcp4   192.168.1.10:8080     *:*
www      httpd      1683  7  tcp4   192.168.1.10:443      *:*
www      httpd      1682  6  tcp4   192.168.1.10:8080     *:*
www      httpd      1682  7  tcp4   192.168.1.10:443      *:*
root     httpd      1681  6  tcp4   192.168.1.10:8080     *:*
root     httpd      1681  7  tcp4   192.168.1.10:443      *:*
```

[cmd=]dig +short NS takinium.com[/cmd]

```
a.dns.gandi.net.
b.dns.gandi.net.
c.dns.gandi.net.
```

[cmd=]ping discoverdigitalmarketingtips.com[/cmd]

```
PING www.discoverdigitalmarketingtips.com (192.168.1.10): 56 data bytes
64 bytes from 192.168.1.10: icmp_seq=0 ttl=64 time=0.073 ms
64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.054 ms
```

Error message:

[cmd=]nslookup www.discoverdigitalmarketingtips.com[/cmd]

```
Server:         95.130.12.1
Address:        95.130.12.1#53

** server can't find www.discoverdigitalmarketingtips.com: NXDOMAIN
```

With the IP address (192.168.1.10), it's the same error message

[cmd=]host www.discoverdigitalmarketingtips.com[/cmd]

```
Host www.discoverdigitalmarketingtips.com not found: 3(NXDOMAIN)
```

Can you help, please? What did I forget?

Thanks,

Christophe


----------



## DutchDaemon (Jun 30, 2011)

The domain discoverdigitalmarketingtips.com isn't even showing up in the whois registry yet, so technically it does not even exist yet on the Internet. Since there are no glue records for it, no one can query the DNS servers for it. I guess you'll have to wait until the registrar puts the glue records online.


```
$ whois discoverdigitalmarketingtips.com

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

No match for "DISCOVERDIGITALMARKETINGTIPS.COM".
>>> Last update of whois database: Thu, 30 Jun 2011 11:24:54 UTC <<<
```

Also note that host(1) is a *DNS* lookup utility. It doesn't look at files like /etc/hosts, whereas other utilities like ping(1) might (depending on /etc/nsswitch.conf).


----------



## cleroy61 (Jun 30, 2011)

With your comments and suggestions, I checked my order again to Gandi and I realized that I was mistaken, it's *learn*digitalmarketingtips.com and not *discover*digitalmarketingtips.com

Thanks for your quick help

Christophe


----------



## DutchDaemon (Jun 30, 2011)

First rule in marketing: get the domain name right!


----------



## cleroy61 (Jun 30, 2011)

Your comment made me smile because it is so true and I made a silly mistake.

Have a nice day!

Christophe


----------

