Skip to content

Instantly share code, notes, and snippets.

@blofeldthefish
Forked from magnetikonline/README.md
Last active July 23, 2018 04:26
Show Gist options
  • Save blofeldthefish/1d85153abc153660ce43c1939994254e to your computer and use it in GitHub Desktop.
Save blofeldthefish/1d85153abc153660ce43c1939994254e to your computer and use it in GitHub Desktop.
BIND - delegate a sub domain for a zone.

BIND - delegate a sub domain for a zone

The scenario:

  • DNS zone myzone.com defined in BIND.
  • Authoritative name server at 123.16.123.1.
  • Subzone sub.myzone.com with an authoritative name server at 123.16.123.10.
  • Wishing to forward sub-zone to authoritative name server.

Config

$ORIGIN myzone.com.
$TTL 1D
@ IN SOA ns1.myzone.com. hostmaster.myzone.com. (
	2015010100  ; serial
	21600       ; refresh
	3600        ; retry
	604800      ; expire
	86400 )     ; minimum TTL
;
@		IN  NS  ns1
ns1		IN  A   123.16.123.1	; glue record
ns1sub	IN	A	123.16.123.10	; glue record
;
;
$ORIGIN sub.myzone.com.
$TTL 1D
@		IN  NS  ns1sub.myzone.com.

How it works

  • Client resolver asks for foo.sub.myzone.com from BIND name server.
  • Is given answer of ns1sub.myzone.com as the authoritative name server, is able to resolve the IP address for ns1sub.myzone.com via the parent zone A "glue" record (123.16.123.10).
  • Now resends original query of foo.sub.myzone.com to nameserver server at 123.16.123.10.
  • All done.

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment