Control which clients are allowed to make (recursive) queries to the server.
This example assumes that the LAN sits at 192.168.1.0/24.
access-control: "0.0.0.0/0" allow access-control: "127.0.0.0/8" allow access-control: "192.168.1.0/24" allow
or
access-control: 0.0.0.0/0 refuse access-control: 127.0.0.0/8 allow access-control: ::0/0 refuse access-control: ::1 allow access-control: ::ffff:127.0.0.1 allow
NOTE: By default everything is refused, except for localhost.
Options include:
NOTE: There are many good reasons for restricting access to your DNS server.
The first one is that a DNS server may be used as part of a denial of service attack.
Another reason is that a local DNS server might contain sensitive DNS entries that are not intended to be known by outsiders.
In addition to the Unbound configuration presented here, it is a good idea to block access to your DNS server by using appropriate firewall rules.
The access-control directives are self-explanatory.
Tag access-control with a list of tags (in “” with spaces between).
Clients using this access control element use localzones that are tagged with one of these tags.
access-control-tag: 192.0.2.0/24 "tag2 tag3"
Set action for a particular tag for a given access control element if you have multiple tag values
The tag used to lookup the action is the first tag match between access-control-tag and local-zone-tag where “first” comes from the order of the define-tag values.
access-control-tag-action: 192.0.2.0/24 tag3 refuse
access-control-tag-data: 192.0.2.0/24 tag2 "A 127.0.0.1"
access-control-view: 192.0.2.0/24 viewname