The purpose is to return different responses to different network interfaces for the same DNS request.
It is useful, if you have multiple separated networks and you need to return different IPs of your internal services for the same domain name. Or when you need to respond with some IP address to request from one network while responding with NXDOMAIN to the same request from other network.
For example:
/ip/dns/static/add name=someserver.com address=192.168.1.1 interfaces=ether2,ether3
/ip/dns/static/add name=someserver.com address=192.168.2.1 interfaces=ether4
In this example, if the DNS request ‘someserver.com’ comes from:
- ether2 or ether3 - a router would return 192.168.1.1
- ether4 - a router would return 192.168.2.1
- some other interface - a router would forward this request to upstream DNS server.
In case no interfaces were specified for a static entry, a router should act as before - i. e. process such entry for all interfaces.
Another example:
/ip/dns/static/add name=someserver.com address=192.168.1.1 interfaces=ether2,ether3
/ip/dns/static/add name=someserver.com type=NXDOMAIN interfaces=ether4
Same as above, but for ether4 it will return ‘no such address’ response, so it will be impossible for anyone on this network interface to get the address, that belongs to another network.