问题原文
原帖链接 · Arnav Gupta · CC BY-SA 3.0
So I looked through BIND and Dnsmasq and unable to figure this out.
I have a few of servers on DigitalOcean, and they are on the same datacenter. I want to be able to use internal IPs to get better intra network pings and (obviously, free private network traffic). Given the following two servers:
Name Public IP Private IP
srv1 192.0.2.1 10.10.10.1
srv2 198.51.100.2 10.10.10.2
When digging from external network (say my laptop), I want something like this
account.codingblocks.com. 79 IN CNAME srv2.cb.lk.
srv2.cb.lk. 85844 IN A 198.51.100.2
When digging from inside srv1, I want this instead
account.codingblocks.com. 79 IN CNAME srv2.cb.lk.
srv2.cb.lk. 85844 IN A 10.10.10.2
Is this possible ? If yes, how.
已采纳解答
原帖链接 · telcoM · CC BY-SA 3.0
In BIND 9, you can define multiple "views": in effect, BIND shows one version of a DNS zone to specified clients and another version to others. This seems to be exactly what you'll need.
Here is a nice introduction to using views in BIND 9: https://kb.isc.org/article/AA-00851/0/Understanding-views-in-BIND-9-by-example.html
In your case, though, the external view would say:
match-clients { any; };
rather than specifying any network segments.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
