I want to configure bind9 to be a local DNS only with no internet access at all. So I have 5 PCs in my virtual domain xy.com. Within this domain there is no access to the internet.
The DNS server has entries like:
- pc1.xy.com IN A 10.1.1.1
- pc2.xy.com IN A 10.1.1.2
- .
- .
- pc5.xy.com IN A 10.1.1.5
Bind is configured correctly but when I do a "dig @localhost pc1" on the DNS server it does not work because he gets stuck contacting the root servers. But I only want him to be local and to answer which IP pc1 has.
How can I achieve this?
To achieve this you need to create a fake root zone to replace the "root.hints" zone that's normally configured.
In
named.conf
put this:and in
fake.root
put this:This will prevent all attempts to access the internet to obtain the real root hints.
You can also put your
pcN.xy.com
entries directly into that root zone, too - there's no need for them to be in their ownxy.com
zone file, so you can just append the following tofake.root
:Apart from any
options { }
that you may need (ACLs?) that's it - nothing else required.You need to disable recursion:
Add to the config:
allow-transfer {“none”;};
allow-recursion {“none”;};
My config "named.conf" looks like this (on RHEL system):
You did not describe your configuration in enough detail. I think you are missing the authoritative part. You need to have a block like this in your config files:
where
master/db.domain.lan
should point to the zone file which should contain the records you posted above. Also, the zone file should have SOA (start of authority) record in its header. The zone file should like like:You can customize the names/values/IPs according to your needs.