大网数据广告活动
服务器运维问答

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

· 52CE 我爱测

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 t…

问题原文

原帖链接 · iamsumesh · CC BY-SA 4.0

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 · CC BY-SA 4.0

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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-04-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。