2

We have an intranet DNS server using Unbound in FreeBSD. We have another file server with multiple network IP, First one is 10.10.10.10 and Second one in 192.168.10.10.

Is there any way that DNS server provide different IP for this file server based on the client network?

Eg: For the user from 10.10.x.x network, fileserver ip should be 10.10.10.10 For the user from 192.168.x.x network, fileserver ip should be 192.168.10.10.

Rob
  • 1,137
  • 7
iamsumesh
  • 145
  • 6
  • I'am not a BSD expert, but I know in enterprise grade firewall you can do a reverse NAT policy to solve that problem. That make that if a request for the bad IP come inside the LAN, it rewrite the destination to the correct IP. Like if in 10.10.10.* and it request 192.168.10.10, the router correct to 10.10.10.10 the conversation – yagmoth555 Apr 28 '22 at 13:58
  • The jargon term for that is usually "split horizon" - See this answer: https://serverfault.com/a/1058218/960939 using the `access-control-view` feature and the docs here: https://unbound.docs.nlnetlabs.nl/en/latest/topics/filtering/tags-views.html – Rob Apr 28 '22 at 14:18

1 Answers1

3

How to provide different IP for a server based on client network

The jargon for that is normally "split horizon DNS".

In Unbound that is implemented via "tags and views" functionality. Those make it possible to send specific DNS answers based on the IP address of the client.

The tags functionality makes it possible to divide client source addresses in categories (tags), and use local-zone and local-data information for these specific tags.

A view is a named list of configuration options. The supported view configuration options are local-zone and local-data.

A view is configured using a view clause. There may be multiple view clauses, each with a unique name. For example:

view:
    name: "firstview"
    local-zone: example.com inform
    local-data: 'example.com TXT "this is an example"'
    local-zone: refused.example.nl refuse

...

Mapping a view to a client can be done using the access-control-view element:

 access-control-view: 10.0.5.0/24 firstview
Rob
  • 1,137
  • 7