; This zone file assumes the zone name is 'example.com'

; Before setting $ORIGIN, create a couple of records to check the default
; $ORIGIN matches the zone name. Note, first record must be SOA.
@ IN SOA ns1.example.com. hostmaster (
			2003080800 ; se = serial number
			12h ; ref = refresh
			15m ; ret = update retry
			3w ; ex = expiry
			3h ; min = minimum
			) ; Should give email 'hostmaster.example.com.'

default IN A 0.1.2.3 ; Should give default.example.com. A 0.1.2.3
tc IN CNAME test ; Should give tc.example.com. CNAME test.example.com.

; Test that $ORIGIN is substituted into non-fully qualified names
$ORIGIN example.com.
@ IN A 1.2.3.4 ; fqdn = example.com.
www IN A 2.3.4.5 ; fqdn = www.example.com.

; Check both record names and RDATA (across record types as appropriate)
test-cname IN CNAME r1 ; Should give test-cname.example.com. CNAME r1.example.com.
test-mx IN MX 10 m1 ; Should give test-mx.example.com MX 10 m1.example.com.
test-ns IN NS ns1 ; Should give test-ns.example.com NS ns1.example.com.
test-srv IN SRV 1 2 3 srv1 ; Should give test-srv.example.com SRV 1 2 3 srv1.example.com.

; And repeat the above, this time with fully-qualified targets
test-cname2 IN CNAME r1. ; Should give test-cname2.example.com. CNAME r1.
test-mx2 IN MX 10 m1. ; Should give test-mx2.example.com MX 10 m1.
test-ns2 IN NS ns1. ; Should give test-ns2.example.com NS ns1.
test-srv2 IN SRV 1 2 3 srv1. ; Should give test-srv2.example.com SRV 1 2 3 srv1.

; Check that changes to $ORIGIN are picked up
$ORIGIN subzone.example.com.
@ IN A 3.4.5.6 ; fqdn = subzone.example.com.
www IN A 4.5.6.7 ; fqdn = www.subzone.example.com.
test-cname IN CNAME r1 ; Should give test-cname.subzone.example.com.

; CNAME r1.subzone.example.com.
; Check $ORIGIN from outside zone is permitted (but not for record names)
; Also check that $ORIGIN without '.' terminator has one added (and a warning)
$ORIGIN foo.com
record.example.com. IN CNAME bar ; Should give record.example.com. CNAME bar.foo.com.

; A fully-qualified name that is within the zone should work OK
test.example.com. IN A 7.8.9.0 ; Should work OK