Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How would I use the BIND "views" feature in Unbound? I don't seem to be able to find anything online regarding this.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Unbound doesn't support split-horizon DNS. It's primarily meant as a recursive and caching nameserver, and has only limited support for serving authoritative answers.

You can sort of fake it in some circumstances through its stub zone feature and/or its local-data option, but for the normal scenario you'd use split-horizon DNS for (a network with RFC1918 addresses), Unbound has nothing.

share|improve this answer

No, Unbound is "only" a resolver. Try an authoritative nameserver software instead.

Wikipedia has a feature matrix explicitly mentioning 'split horizon':

http://en.wikipedia.org/wiki/Comparison_of_DNS_server_software#Feature_matrix

share|improve this answer

If you really really want to stick with Unbound, you could possibly fake it by running multiple instances of Unbound on different ip addresses and then using iptables to forward based on the source address.

Taking 192.0.2.1 as the ip of your server and 198.51.100.0/24 as the range you want to present a different view to, you could do something like follows:

  • Unbound 1: Bound to 192.168.0.2.1:53
  • Unbound 2: Bound to 127.0.0.1:53 (or another ip address on the loopback adapter)

In iptables put the following rules (untested, but should work):

iptables -A PREROUTING -s 198.51.100.0/24 -p udp -m udp --dport 53 -j DNAT --to 127.0.0.1:53
iptables -A PREROUTING -s 198.51.100.0/24 -p tcp -m tcp --dport 53 -j DNAT --to 127.0.0.1:53

However, I don't recommend going this way as Bind is the better tool for this job, and hacks like the above become a pain to admin further down the line.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.