# DNS Resolution issues



## QuinRiva (Aug 2, 2014)

I'm trying to configure my server for ease access for locally hosted websites.  Ideally I would like to access sickbeard (http://myserver.domain.local:8081) through a shorter URL: http://sickbeard

Locally everything seems to work, but from my client computer I just get a DNS error.

For reference:

Server Name: Pride
Domain Name: sin.x

This is a conf file that I have included in httpd.conf:

```
zone "mywebsite.sin.x" {
        type master;
        file "/usr/local/etc/namedb/zones/mywebsite.sin.x";
  };
```

The file /usr/local/etc/namedb/zones/mywebsite.sin.x looks like this:

```
; BIND data file for mywebsite.sin.x
;
$ORIGIN mywebsite.sin.x.
$TTL    604800

@       IN      SOA     pride.mywebsite.sin.x. myemail.mywebsite.sin.x. (
                                2009120106 ; Serial
                                604800 ; Refresh
                                86400 ; Retry
                                2419200 ; Expire
                                604800 ) ; Negative Cache TTL
;

                IN      NS      pride.mywebsite.sin.x.
                IN      MX 10   mail.mywebsite.sin.x.

localhost       IN      A       127.0.0.1
mywebsite.sin.x. IN      A       192.168.0.1
pride           IN      A       192.168.0.1

www             IN      A       192.168.0.1
ftp             IN      A       192.168.0.1
mail            IN      A       192.168.0.1

boards          IN      CNAME   www
```
Obviously there is a lot of extra stuff from the guide that I don't need in there.

I've also ensured that Apache http proxy is correctly configured:

```
<VirtualHost *:80>
        ServerName mywebsite.sin.x
        DocumentRoot /usr/local/www/apache24/data/

</VirtualHost>
```

And locally, at least everything seems to work:

```
root@pride:/usr/local/etc/namedb # curl mywebsite.sin.x
<html><body><h1>It works!</h1></body></html>
```

From my windows machine, it doesn't seem to work, I can't connect to the website through: http://mywebsite.sin.x
Note, that the website *does *load if I try connecting to it via http://pride.sin.x

This is the response from the windows nslookup:

```
H:\Users\quinriva>nslookup pride
DNS request timed out.
    timeout was 2 seconds.
Server:  UnKnown
Address:  192.168.0.1

DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
*** Request to UnKnown timed-out
```

I have no idea what I'm doing, please help.


----------



## SirDice (Aug 3, 2014)

Your DHCP server should supply a domain-search. Set this to your domain. The domain-search will get appended on simple hostname lookups. On Windows you should be able to see this setting:

```
C:\Users\dice>nslookup
Default Server:  maelcum.dicelan.home
Address:  192.168.10.1

> set all
Default Server:  maelcum.dicelan.home
Address:  192.168.10.1

Set options:
  nodebug
  defname
  search
  recurse
  nod2
  novc
  noignoretc
  port=53
  type=A+AAAA
  class=IN
  timeout=2
  retry=1
  root=A.ROOT-SERVERS.NET.
  domain=dicelan.home
  MSxfr
  IXFRversion=1
  srchlist=dicelan.home

> exit

C:\Users\dice>ping molly
Pinging molly.dicelan.home [2001:470:1f15:bcd::190] with 32 bytes of data:
Reply from 2001:470:1f15:bcd::190: time<1ms
Reply from 2001:470:1f15:bcd::190: time<1ms
Reply from 2001:470:1f15:bcd::190: time<1ms
Reply from 2001:470:1f15:bcd::190: time<1ms

Ping statistics for 2001:470:1f15:bcd::190:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
```
Note the domain and srchlist.

And if you want your site to have multiple hostnames you can add an alias:

```
<VirtualHost *:80>
        ServerName mywebsite.sin.x
        ServerAlias pride.sin.x
        DocumentRoot /usr/local/www/apache24/data/

</VirtualHost>
```
Or else you get the default website.


----------

