我正在尝试解析 Azure 中数据库的私有(private)和公共(public) IP 地址。我通过 VPN 连接执行此操作。我目前在 Azure 中有 2 个 DNS 转发器虚拟机,它们在我的 VPN 配置中被指定为 DNS 服务器。 DNS转发配置如下:
acl goodclients {
10.0.0.0/8;
localhost;
localnets;
};
options {
directory "/var/cache/bind";
recursion yes;
allow-query { goodclients; };
forwarders {
168.63.129.16;
};
forward only;
dnssec-enable yes;
dnssec-validation yes;
auth-nxdomain no; # conform to RFC1035
listen-on { any; };
};
我在 Azure 中有两台数据库服务器,其中一台有一个私有(private)终结点,该终结点在私有(private) DNS 区域中有记录,另一台则没有。当我现在尝试使用 nslookup 解析 ip 时,我得到以下结果:
- 拥有私有(private)链接的会按预期返回其私有(private) IP
- 找不到没有私有(private)链接的:** 服务器找不到 db1.database.windows.net: NXDOMAIN
这是否意味着我无法将私有(private) DNS 区域与同一域上的非私有(private)资源结合使用?我期望 Azure DNS 能够解析两者(超过 168.63.129.16)
更新 我能够缩小范围。似乎当您添加专用端点并且不在您的专用 DNS 区域中注册该端点时,它不再起作用。我期望仍然能够解析公共(public) IP,因为 DNS 此时不知道有关专用端点的任何信息,并且我没有更改数据库服务器上的防火墙设置? 在此特定场景中,我在 Azure 数据工厂上使用新的托管 VNet 选项来私下访问数据库。我暂时也希望能够使用公共(public)IP。
最佳答案
在 this 中找到以下内容文档:
Private networks already using the private DNS zone for a given type, can only connect to public resources if they don't have any private endpoint connections, otherwise a corresponding DNS configuration is required on the private DNS zone in order to complete the DNS resolution sequence.
这证实了我在问题更新中发现并解释的内容。
关于Azure DNS 转发器无法使用公共(public)资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65593773/