LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Dedicated server DNS and domain name setup (http://www.linuxquestions.org/questions/linux-server-73/dedicated-server-dns-and-domain-name-setup-918184/)

Luna-tic 12-11-2011 10:54 AM

Dedicated server DNS and domain name setup
 
Hello.

I have a dedicated Centos5 64-bit server. Also, I have a domain name which I want to use to access the server using "server.mydomain.com". Currently, the server has apache running, however it is not reachable using any domain name (only by IP).

I have set up BIND and configured it using the tutorials I found on the net. If I run `host mydomain.com` on the server it returns the correct IP, however if I run it on my local machine it says "Host xxxx not found: 3(NXDOMAIN)". I called the ISP before and they told me that if I have a domain name (the domain names was not bought at the server provider) I have to set up my server's DNS server to that domain and all will work. Could someone explain me how such a thing can be done because I'm lost?

EDIT: If it changes anything, the server has ISPConfig3 running.

Thanks!

my named.conf
Code:

options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { any; };
        directory        "/var/named/chroot/var/named";
        dump-file        "/var/named/chroot/var/named/data/cache_dump.db";
        statistics-file "/var/named/chroot/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/chroot/var/named/data/named_mem_stats.txt";
        allow-query    { any; };
        recursion yes;
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};


zone "." IN {
        type hint;
        file "named.root";
};
zone "mydomain.com" {
      type master;
      file "/var/named/chroot/var/named/mydomain.com.zone";
};

//The next is the reverse DNS entry.
zone "123.123.123.in-addr.arpa" {
        type master;
        file "/var/named/chroot/var/named/123.123.123.db";
};


include "/var/named/chroot/var/named/named.local";

mydomain.com.zone
Code:

$TTL 3h

@        IN        SOA            ns.mydomain.com. root.mydomain.com. (
                2006120702        ; counter/ Serial    ; in the format YYYYMMDDCC where CC - counter 1 to 99
                20m            ; refresh
                15m            ; Retry Interval
                1w              ; Expire
                1h )            ; Negative Cache TTL

        IN        NS        ns.mydomain.com.       
        IN        MX        10        mail.mydomain.com.

ns        IN        A        123.123.123.123
mail    IN        A        123.123.123.123
www    IN        A        123.123.123.123
@        IN        A        123.123.123.123

my 123.123.123.db
Code:

@        IN        SOA    mydomain.com. root.mydomain.com. (
                3        ; counter/ Serial
                15m    ; refresh
                15m    ; Retry Interval
                1w        ; Expire
                1h )    ; Negative Cache TTL

        IN        NS        ns.mydomain.com.

250    IN        PTR    server.mydomain.com.

P.S. The real domain name is changed to mydomain.com and the IP address to 123.123.123.123

bathory 12-11-2011 01:34 PM

Quote:

I called the ISP before and they told me that if I have a domain name (the domain names was not bought at the server provider) I have to set up my server's DNS
server to that domain and all will work. Could someone explain me how such a thing can be done because I'm lost?
You should contact your registrar (the company you used to buy your domain) and change the name server(s) to point to your host(s)
Use this site to see details about your domain

Regards

Luna-tic 12-11-2011 01:46 PM

Quote:

Originally Posted by bathory (Post 4547330)
You should contact your registrar (the company you used to buy your domain) and change the name server(s) to point to your host(s)
Use this site to see details about your domain

Regards

The company that sold the domain gives me a web gui to setup the nameservers for all the domains I have. In the settings, I have to enter domain names of the nameservers for my domain. If I enter IP addresses, it doesn't work. Right now I entered the company that sold me the domain nameserver and my domain's ns.mydomain.com.

Luna-tic 12-11-2011 02:02 PM

Quote:

Originally Posted by bathory (Post 4547330)
You should contact your registrar (the company you used to buy your domain) and change the name server(s) to point to your host(s)
Use this site to see details about your domain

Regards

IntoDNS tells me this:

Code:

Nameserver records returned by the parent servers are:

ns2.domaincompany.com  ['22.22.22.22']  [TTL=7200]
ns.mydomain.com.  [] (NO GLUE)  [TTL=7200]

e.tld.lt was kind enough to give us that information.


bathory 12-11-2011 02:26 PM

Quote:

ns.mydomain.com. [] (NO GLUE) [TTL=7200]
So you miss the glue record. You should contact them in order to register your host as a nameserver. After that, using just the hostname will be enough to use your host as a nameserver for any other domain you own.
Maybe this is already fixed, but you have to wait until your domain data is propagated to the root servers.
Try:
Code:

dig +trace mydomain.com
to see if the root servers down to the parent of your dns are aware of your domain

Luna-tic 12-11-2011 02:35 PM

Quote:

Originally Posted by bathory (Post 4547374)
So you miss the glue record. You should contact them in order to register your host as a nameserver. After that, using just the hostname will be enough to use your host as a nameserver for any other domain you own.
Maybe this is already fixed, but you have to wait until your domain data is propagated to the root servers.
Try:
Code:

dig +trace mydomain.com
to see if the root servers down to the parent of your dns are aware of your domain

This is what I got.

Code:

; <<>> DiG 9.8.1 <<>> +trace mydomain.com
;; global options: +cmd
.                        362475        IN        NS        l.root-servers.net.
.                        362475        IN        NS        j.root-servers.net.
.                        362475        IN        NS        g.root-servers.net.
.                        362475        IN        NS        i.root-servers.net.
.                        362475        IN        NS        b.root-servers.net.
.                        362475        IN        NS        c.root-servers.net.
.                        362475        IN        NS        k.root-servers.net.
.                        362475        IN        NS        a.root-servers.net.
.                        362475        IN        NS        f.root-servers.net.
.                        362475        IN        NS        h.root-servers.net.
.                        362475        IN        NS        d.root-servers.net.
.                        362475        IN        NS        m.root-servers.net.
.                        362475        IN        NS        e.root-servers.net.
;; Received 512 bytes from 222.222.222.222#53(222.222.222.222) in 36 ms

lt.                        172800        IN        NS        c.tld.lt.
lt.                        172800        IN        NS        b.tld.lt.
lt.                        172800        IN        NS        d.tld.lt.
lt.                        172800        IN        NS        a.tld.lt.
lt.                        172800        IN        NS        e.tld.lt.
;; Received 272 bytes from 192.33.4.12#53(192.33.4.12) in 95 ms

mydomain.com.                        7200        IN        NS        ns.mydomain.com.
mydomain.com.                        7200        IN        NS        ns2.domaincompany.com.
dig: couldn't get address for 'ns.mydomain.com': not found

222.222.222.222 matches the IP of the nameserver that handled mydomain.com a few weeks ago.

bathory 12-11-2011 03:04 PM

Contact your registrar to see how to register your host as a nameserver (i.e. both the hostname and IP address), so you get the glue record.
Read this to understand why you have to do that.
Or you could use your registrar dns (ns2.domaincompany.com) as a master dns and your host as a secondary for your primary domain (mydomain.com) and then for the rest of the domains you own, you can use ns.mydomain.com as the master dns


All times are GMT -5. The time now is 06:10 AM.