Set a default reply in BIND

James Philpott jamesp at metainfo.com
Sat Jun 18 01:33:43 UTC 2005


Barry Margolin wrote:
> In article <d8v1o2$309k$1 at sf1.isc.org>, Elias <elias at streamyx.com> 
> wrote:
> 
> 
>>Hi,
>>Is there anyway to configure BIND to return a single default answer if it is 
>>not authoritative for that zone? For eg if I'm authroritative for abc.com, 
>>the server will return everything related to abc.com (and this is already 
>>working) but when somebody queries for xyz.com, 123.com, 
>>1.2.3.4.in-addr.arpa, etc it should just return one same answer. Is there 
>>anyway to put a wildcard for this?
> 
> 
> Make your server authoritative for the root zone, and put a wildcard in 
> the root zone file.
> 

You'll also want the root zone file to have an NS record pointing to 
itself and an A record for the name you use in the RDATA. The RDATA I'm 
referring to in the NS record is "my-dns-server" (it can be anything you 
want it to be.

e.g. the zone file should read something like the following:
$TTL 86400

@	IN	SOA	my-dns-server.	hostmaster.example.com. (
		3;
		10800;
		1800;
		604800;
		1800;
		);

*                IN A     10.0.0.1
@                IN NS    my-dns-server.
my-dns-server.    IN A     10.14.21.1

This won't make the server good for much else though. If this is also 
the server on which you are hosting your master or slave or stub zones, 
then you will need to create delegation at every level building up to 
your normal zone data. If you do not, then your zones will not be able 
to be resolved.

By delegation at every level I mean the following:

If you are hosting the zone mumbo.jumbo.example.com on the same name 
server then you will need an NS record in the master root zone . that 
points to your DNS server name. You will also need master zones to 
delegate from org. to example.org.; from example.org. to 
jumbo.example.org.; and from jumbo.example.org. to mumbo.jumbo.example.org.

e.g. zone file for org.
@	IN	SOA	my-dns-server.	hostmaster.example.com. (
		3;
		10800;
		1800;
		604800;
		1800;
		);

@                IN NS    my-dns-server.
example          IN NS    my-dns-server.


e.g. zone file for example.org.
@	IN	SOA	my-dns-server.	hostmaster.example.com. (
		3;
		10800;
		1800;
		604800;
		1800;
		);

@                IN NS    my-dns-server.

e.g. zone file for jumbo.example.org.
@	IN	SOA	my-dns-server.	hostmaster.example.com. (
		3;
		10800;
		1800;
		604800;
		1800;
		);

@                IN NS    my-dns-server.
my-dns-server.    IN A     10.14.21.1

e.g. zone file for mumbo.jumbo.example.org.
@	IN	SOA	my-dns-server.	hostmaster.example.com. (
		3;
		10800;
		1800;
		604800;
		1800;
		);

@                IN NS    my-dns-server.
<all of your other mumbo.jumbo.example.org. data goes here in this file>

</end long explanation>

There are many ways to accomplish this but the simple version is what 
I'm describing here. This is not a hard thing to do, but understanding 
it is either something you get or something you struggle to understand.

-- 

Hope this helps,
James Philpott



More information about the bind-users mailing list