DNS Bind9 in Debian Etch

Discussion in 'HOWTO-Related Questions' started by lordshadow, May 7, 2008.

  1. lordshadow

    lordshadow New Member

    Hi,

    I'm trying to get my server to recognize it's domain name name so I created an internal DNS server which I'm trying to point to the domain optiplex-networks.tk, through browser I want www.optiplex-networks.tk to resolve.

    This works fine through WAN as DNS server comes off site where I got the domain name from.

    However in my internal network it doesn't resolve which is why I'm doing this!

    My zone file looks like this:

    Code:
    ;
    ; BIND data file for example.com
    ;
    $TTL    604800
    @       IN      SOA     optiplex-networks.tk. info.optiplex-networks.tk. (
                                2008051605         ; Serial
                                      7200         ; Refresh
                                       120         ; Retry
                                   2419200         ; Expire
                                    604800)        ; Default TTL
    ;
    @       IN      NS      ns1.optiplex-networks.tk.
    #@       IN      NS      ns2.example.com.
    optiplex-networks.tk.    IN      MX      10      mail.optiplex-networks.tk.
    optiplex-networks.tk.    IN      A       192.168.1.51
    www                     IN      CNAME   optiplex-networks.tk.
    mail                    IN      A       192.168.1.51
    ftp                     IN      CNAME   ftp.optiplex-networks.tk.
    optiplex-networks.tk.   IN      TXT     "v=spf1 ip4:192.168.1.51 a mx ~all"
    mail                    IN      TXT     "v=spf1 a -all"
    
    and I have added this to named.conf.local:

    Code:
    zone "optiplex-networks.tk" {
           type master;
           file "/var/named/optiplex-netowrks.db";
    };
    
    zone "1.168.192.IN-ADDR.ARPA" {
           type master;
           file "/var/named192.168.1.rev";
    };
    
    however this sort of works internally from server: http://optiplex-networks.tk resolves but www.optiplex-networks.tk doesn't and from anyother computer on the network it doesn't resolve at all!

    Can any one help?
     
  2. lordshadow

    lordshadow New Member

  3. lordshadow

    lordshadow New Member

    Ok I managed to get this one working. It was a simple case of editing the resolv.conf and hosts files. Also a little DNS zone forwarding through my Cisco router and I have perfect intranet functionality.

    However from outside (WAN) I can't access ftp.optiplex-networks.tk??

    I don't understand why as I registered the name optiplex-networks.tk. It's a free domain name so that maybe the reason why WAN DNS queries aren't found but I would've thought that through reverse lookup in my server's DNS server and routers DNS server that internet hosts would find it??

    Maybe someone could explain domain hosting to me in the relevant areas so I understand better?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Code:
    mh1:~# dig ftp.optiplex-networks.tk
    
    ; <<>> DiG 9.3.4 <<>> ftp.optiplex-networks.tk
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63911
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;ftp.optiplex-networks.tk.      IN      A
    
    ;; ANSWER SECTION:
    ftp.optiplex-networks.tk. 300   IN      A       193.33.61.2
    ftp.optiplex-networks.tk. 300   IN      A       209.172.59.193
    ftp.optiplex-networks.tk. 300   IN      A       217.115.151.98
    ftp.optiplex-networks.tk. 300   IN      A       195.20.32.104
    ftp.optiplex-networks.tk. 300   IN      A       217.119.57.19
    
    ;; Query time: 205 msec
    ;; SERVER: 213.133.98.98#53(213.133.98.98)
    ;; WHEN: Thu May  8 21:30:17 2008
    ;; MSG SIZE  rcvd: 122
    
    mh1:~#
    That hostname is pointing to multiple IP addresses. Are these all your servers?
     
  5. lordshadow

    lordshadow New Member

    These servers are not mine, in fact my server is located at 81.178.2.118!

    The thing is I can't understand why it isn't working as I registered the domain name optiplex-networks.tk. I'm not the owner and that maybe why this is happening but I fail to understand why I'm able to access www.optiplex-networks.tk and not anything else with it?
     
  6. snewp

    snewp New Member

    remove this:
    ftp IN CNAME ftp.optiplex-networks.tk.

    you can have:
    ftp IN CNAME www

    or

    ftp IN A IP address
     
  7. lordshadow

    lordshadow New Member

    Ok I changed the format to:

    ftp IN CNAME www

    I don't currently have access to another internet line so I don't know if anyone could check to see if it works or not?
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Still not ok:

    Code:
    mh1:~# dig ftp.optiplex-networks.tk
    
    ; <<>> DiG 9.3.4 <<>> ftp.optiplex-networks.tk
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38954
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;ftp.optiplex-networks.tk.      IN      A
    
    ;; ANSWER SECTION:
    ftp.optiplex-networks.tk. 300   IN      A       217.119.57.19
    ftp.optiplex-networks.tk. 300   IN      A       193.33.61.2
    ftp.optiplex-networks.tk. 300   IN      A       195.20.32.104
    ftp.optiplex-networks.tk. 300   IN      A       209.172.59.193
    ftp.optiplex-networks.tk. 300   IN      A       217.115.151.98
    
    ;; Query time: 365 msec
    ;; SERVER: 213.133.98.98#53(213.133.98.98)
    ;; WHEN: Fri May  9 15:15:29 2008
    ;; MSG SIZE  rcvd: 122
    
    mh1:~#
    But I see that there are no DNS server defined for the domain: :eek:

    Code:
    mh1:~# dig ns optiplex-networks.tk
    
    ; <<>> DiG 9.3.4 <<>> ns optiplex-networks.tk
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23858
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;optiplex-networks.tk.          IN      NS
    
    ;; Query time: 147 msec
    ;; SERVER: 213.133.98.98#53(213.133.98.98)
    ;; WHEN: Fri May  9 15:15:39 2008
    ;; MSG SIZE  rcvd: 38
    
    mh1:~#
     
  9. lordshadow

    lordshadow New Member

    hmm, :confused: internally it works fine as ns1.optiplex-networks.tk resolves to my Cisco router also my server??

    What information could I provide that will help get me to a solution?
     
  10. snewp

    snewp New Member

    it would be better to have your own domain.
     
  11. lordshadow

    lordshadow New Member

    Thanks for the advice and it is something that I'm looking into; that's why I went for the free one as it would save me money initially so I could learn about domain and hosting.

    I have found many places that offer domain names but they seem to only let me have it for upto 2 years?

    Is this correct or am I looking at something else maybe domain renting?

    Maybe someone could give me a good place to get the domain name from that is cost effective and that I can have for a while or that would come to a good renewal agreement if there is a max time limit.

    Actually come to think about it would DNS completely work then? I just want to know that my DNS settings are all correct!
     
  12. falko

    falko Super Moderator Howtoforge Staff

    Usually registrars let you register a domain for a period of one to ten years before it gets renewed. Most registrar also let you use their name servers for the domains you register with them, so you don't need a name server of your own.
     
  13. lordshadow

    lordshadow New Member

    So if I register my domian, eg: mydomain.com

    will that mean that anything associated with mydomain.com is mine? e.g. ftp.mydomain.com or www.mydomain.com or mail.mydomain.com??

    Since my services are behind a router would this mean that the DNS servers of the registrar would then point all these names to my static IP leaving my router or internal DNS server to route the external DNS queries internally?
     
  14. falko

    falko Super Moderator Howtoforge Staff

    Yes.

    You must configure your router to forward all desired ports to the desired machine in your LAN.
     
  15. lordshadow

    lordshadow New Member

    Thanks so much now everything is clear to me!

    I have opened ports on my router it seems that it's just a matter of sorting out full domain privillages for myself and my new company. (still so much to learn though haha :) )

    As my router is an internal DNS server anyway, along with my Debian server as say a backup DNS server are there any ports I could open up to forward DNS queries?
     
  16. falko

    falko Super Moderator Howtoforge Staff

    For DNS, you must open port 53 (TCP and UDP).
     
  17. lordshadow

    lordshadow New Member

    Thanks so much for everything!! :)

    I opted for the "real" domain option and the registrars DNS servers are pointing to my IP address so I have all services up and running.

    I will open port 53 just to play about with DNS and see if I can figure out some more stuff but at least now www.optiplex-networks.com is in my name and the company is about to go live soon.
     

Share This Page