Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a lot of zones defined in my DNS server. I need to delegate one particular zone to a foreign DNS server and I don't have access to my domain-registrar control panel, currently. Is there a way in Bind to delegate the resolution of a whole zone to another DNS server?

I thought it was possible to just name the foreign server ns1.delegatenameserver.com in the zone file but it's not working.

$TTL 3600
@               IN SOA ns1.delegatednameserver.com. hostmaster.ariel.org. (
                        2013120904      ;serial
                        3600            ;refresh
                        360             ;retry
                        86400           ;expire
                        3600            ;minimum
                )

                IN NS           ns1.delegatednameserver.com.
share|improve this question

The address of the name server is missing in this zone declaration.

Add the following to your declaration file.

ns1  IN A  ip.of.delgated.server
share|improve this answer

It's not entirely clear from your question how far along you are, but to delegate a subdomain you have to have control over its parent domain.

So, if you control example.com and want to delegate sub.example.com to another DNS, you have to do:

In example.com's zone file

## this is the "glue" record
sub.example.com. IN NS ns1.sub.example.com.
ns1.sub.example.com. IN A 123.123.123.123 ;; IP address of the foreign DNS server to which you're delegating

In the foreign DNS server

## you must have configured the sub.example.com zone
@           IN SOA ns1.sub.example.com. hostmaster.sub.example.com. (
                    2016060700      ;serial
                    3600            ;refresh
                    360             ;retry
                    86400           ;expire
                    3600            ;minimum
            )

                     IN NS  ns1.sub.example.com.
ns1.sub.example.com. IN A   123.123.123.123

www                  IN A   121.121.121.121
;; etc

Note that you can only properly delegate a subdomain, and to achieve it you must control its upper-level domain.

If you don't have control over the upper-level domain, you can still transfer load/responsibility over a domain by other means.

Let's say you control example.com at ns1.example.com (delegator) and want to delegate to ns3.example.com (delegatee).

1. add extra NS records to the zone file in ns1.example.com and set up a master/slave relationship

Your delegator nameserver will still get requests, but some clients will hit the delegatee. You must set up example.com as a slave zone in ns3.example.com with master ns1.example.com for this to work. You will still have control of example.com in your delegator nameserver.

2. forward the zone to ns3.example.com

You can forward every request you receive to example.com by configuring

zone "example.com" IN { type forward; forwarders { 122.122.122.122; }; }; // ns3.example.com

You will still receive every request for example.com on your delegator nameserver, which will then send the request forward but control of the zone contents will be entirely under control of the delegatee ns3.example.com. In the delegatee nameserver, example.com must be configured as a master zone.

3. ns1.example.com as slave

You can set up example.com as a slave zone in ns1.example.com with master ns3.example.com.

This is similar to option 2 above, with the difference that ns3.example.com won't be receiving any DNS requests from the world, only zone transfer requests from ns1.example.com. ns1.example.com also keeps a cached copy of the zone and will still answer queries if ns3.example.com goes down.

share|improve this answer

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.