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:


// 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 {; };
    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 
www                   IN    A
ftp                   IN    A 
mail                  IN    A 
smtp                  IN    A 
pop                   IN    A 
media.j-in.org.ua.    IN    TXT   "v=spf1 ip4: 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

;media.j-in.org.ua.     IN  A

media.j-in.org.ua.  3600    IN  A

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
;; WHEN: Mon Oct 19 17:49:39 2009
;; MSG SIZE  rcvd: 109


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

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


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...

  • +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. – dadver Oct 19 '09 at 14:47

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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