Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to learn how to use dns server "named" on Fedora to create subdomains. Have only a little knowledge how to do it... All manual pages I found on the question, are very complicated. So I am searching for some short examples, and maybe ways to checks them. Here is my named.conf:

/etc/named.conf:

// 
// named.conf 
// 
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS 
// server as a caching only nameserver (as a localhost DNS resolver only). 
// 
// See /usr/share/doc/bind*/sample/ for example named configuration files. 
//

options {
    listen-on port 53 { 127.0.0.1; };
    listen-on-v6 port 53 { ::1; };
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     { localhost; };
    recursion yes; };

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        }; 
};

zone "." IN {
    type hint;
    file "named.ca"; };

include "/etc/named.rfc1912.zones";

zone "ursa.org.ua" {
    type master;
    file "/var/named/ursa.org.ua"; 
}; 

zone "j-in.org.ua" {
    type master;
    file "/var/named/j-in.org.ua"; 
}; 

zone "pravozahist.in.ua" {
    type master;
    file "/var/named/pravozahist.in.ua";
}; 

zone "media.j-in.org.ua" {
    type master;
    file "/var/named/media.j-in.org.ua"; 
};

And also:

Output of cat /var/named/media.j-in.org.ua

$TTL 3600 
media.j-in.org.ua.    IN    SOA   ns1.IDENT.vds.colocall.com. root.oplot.vds.colocall.com. (2009101700 10800 3600 604800 86400) 
media.j-in.org.ua.    IN    NS    ns1.IDENT.vds.colocall.com. 
media.j-in.org.ua.    IN    NS    ns2.IDENT.vds.colocall.com. 
media.j-in.org.ua.    IN    MX    10 mail 
media.j-in.org.ua.    IN    MX    20 mail 
media.j-in.org.ua.    IN    A     62.149.25.66 
www                   IN    A     62.149.25.66
ftp                   IN    A     62.149.25.66 
mail                  IN    A     62.149.25.66 
smtp                  IN    A     62.149.25.66 
pop                   IN    A     62.149.25.66 
media.j-in.org.ua.    IN    TXT   "v=spf1 ip4:62.149.25.66 a mx ~all"

So where should I start from to add a new subdomain, for already registered domain name. for example, I tried to add media.j-in.org.ua, but don't know how to check if it's added?


Thanks for explanation.

Does this mean that subdomain is added?

-bash-3.2$ dig media.j-in.org.ua

; <<>> DiG 9.5.1-P1-RedHat-9.5.1-1.P1.fc10 <<>> media.j-in.org.ua
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61718
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0

;; QUESTION SECTION:
;media.j-in.org.ua. 	IN	A

;; ANSWER SECTION:
media.j-in.org.ua.  3600	IN	A	62.149.25.66

;; AUTHORITY SECTION:
media.j-in.org.ua.  3600	IN	NS	ns2.IDENT.vds.colocall.com.
media.j-in.org.ua.  3600	IN	NS	ns1.IDENT.vds.colocall.com.

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Oct 19 17:49:39 2009
;; MSG SIZE  rcvd: 109

-bash-3.2$
share|improve this question
add comment

2 Answers

You know your nameserver is only going to listen on (and to) 127.0.0.1 and ::1 with this config, right?

Apart from that, you can check whether a nameserver is running correctly by doing a zonetransfer, with

dig @YOUR_HOST YOUR_DOMAIN axfr

Also, though I respect your learning endeavors, are you sure you want to do your own DNS? The amount of familiarity you seem to have with it, leads me to suggesting you let you ISP deal with this. Correctly configuring bind requires a solid understanding of how DNS works, so maybe it would be better not to try these things out in production...

share|improve this answer
    
+1 for pointing out the problematic configuration, however the best way to learn is to experiment. I would however recommend wzzrd to experiment in a LAN rather than with real IPs and domains. –  Mahriman Oct 19 '09 at 14:47
add comment

In order to add subdomains to an already existing domain, your DNS server needs to be authorative for that zone. In the above example, "www", "ftp", "mail", "smtp" and "pop" are all subdomains for subdomain media.j-in.org.ua. One would have to suspect that the DNS server serving j-in.org.ua has an A-record giving media.j-in.org.ua an IP address.

All your DNS configurations can be checked with either the 'dig' command or 'nslookup', depending on operating system.

I would greatly recommend reading the DNS HOW-TO to get a basic idea on how the hierarchy works, it also covers BIND configuration and is based on BIND DNS server.

You can find the DNS How-to here. Also check out the BIND FAQ

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.