将点到站点与 Azure VPN 网关结合使用时私有 DNS 的方法?

Approach for private DNS when using Point-to-Site with Azure VPN Gateway?

我有一些小型开发和支持团队,我需要连接到我们在 Azure 中托管的专用网络。我们正在使用 Windows 服务器为网络中的虚拟机提供 Active Directory 和 DNS。我能够配置 Azure VPN 网关以进行身份​​验证并连接到我们的专用网络。我可以 ping 我们的虚拟机(在进行适当的 NSG 更改后),所以连接现在很好,但我想弄清楚如何在 VPN/individual 机器上正确配置 DNS 服务器。

我个人使用 macOS,但我们混合使用 Windows 和 macOS 机器。 IKEv2 和 SSTP VPN 似乎都没有任何允许调整 connection/disconnection 上的 DNS 服务器的功能。在这种情况下配置自托管私有 DNS 的推荐方法是什么?

我已经为同样的问题苦苦挣扎了一段时间,这似乎至少对我有用。

  1. 将自定义 DNS 设置为虚拟网络网关关联的虚拟网络上的内部 DNS。
  2. 确保在完成第 1 步后重置虚拟网络网关。
  3. 从虚拟网络网关上的点到站点配置下载 VPN 客户端
  4. 修改文件 Mac/VpnClientSetup.mobileconfig 并将以下内容添加到 VPN 负载中。确保调整值 10.0.0.1mydomain.com
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>PayloadContent</key>
        <array>
            <dict>
                ...
            </dict>
            <dict>
                <key>IKEv2</key>
                <dict>
                    ....
                </dict>
                ...
                <key>DNS</key>
                <dict>
                    <key>ServerAddresses</key>
                    <array>
                        <string>10.0.0.1</string>
                    </array>
                    <key>SupplementalMatchDomains</key>
                    <array>
                        <string>mydomain.com</string>
                    </array>
                    <key>SearchDomains</key>
                    <array>
                        <string>mydomain.com</string>
                    </array>
                </dict>
            </dict>
        </array>
        ...
    </dict>
</plist>

有关 descriptions/other 个选项,请参阅 https://developer.apple.com/business/documentation/Configuration-Profile-Reference.pdf。寻找 DNS Dictionary Keys