1

I can test my zone files with named-checkzone, and it looks ok.

45.20.10.in-addr.arpa.zone zone file (reverse DNS):

$TTL 30
@ IN SOA localhost. admin.example.com (
2017080101  ;serial
3H      ;refresh
1H      ;retry
2H      ;expire
1M)     ;neg ttl
@ IN NS localhost.;
;generate 1-254
$GENERATE 1-254 $ IN PTR host$.example.com

example.com.zone zone file:

$TTL 30
@ IN SOA localhost. admin.example.com. (
2017072702  ; serial
3       ; refresh
1       ; retry
2       ; expire
1M)     ; negative TTL
            IN NS localhost.;
www.example.com.    IN A 192.168.111.45
www.example.com.    IN AAAA fe80::22c9:d0ff:1ecd:c0ef
foo.example.com.    IN A 192.168.121.11
bar.example.com.    IN CNAME www.example.com.
;generate 100 hosts
$GENERATE 1-100 host$.example.com. IN A 10.20.45.$

I can test the zone file with the dig command like so dig @localhost -t A www.example.com.

I can also test the reverse zone file like so host 10.20.45.55 localhost.

In the man page of the host command it is said that one could also test like so host host55.example.com localhost, but this yields an error message:

Using domain server:
Name: localhost
Address: 127.0.0.1#53
Aliases: 

Host host55.example.com not found: 2(SERVFAIL)

I am clueless about why that does not work. Any help and explanation would be great.

2

The documentation about $GENERATE gives the following syntax:

$GENERATE start-stop[/step] lhs[{offset[,width[,type]]}] rr-type rhs[{offset[,width[,type]]}]

where rr-type is CNAME, DNAME, A, AAAA, NS, PTR, ...

Therefore, your line:

$GENERATE 1-100 host$.example.com. IN A 10.20.45.$

should instead be:

$GENERATE 1-100 host$.example.com. A 10.20.45.$

It's strange that bind didn't spit any error/warning message about this.

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.