自动更新配置文件中 IP 的脚本

发布于 2024-09-07 01:45:34 字数 228 浏览 4 评论 0原文

问题

我有一个具有动态 IP 地址的 SQL 服务器。不过我有一个网址,例如“mydynamic.com” 它会自动更新为 SQL Server 的当前 IP

要求

我需要一个可以获取此 URL 并解析 IP 的脚本 (vb/bat)。然后获取一个配置文件并用该 IP 替换占位符。这个想法是配置文件将始终指向正确的 IP。

Problem

I have a SQL server that has a dynamic IP address. However I have a url e.g. 'mydynamic.com'
which is automatically updated to the current IP of the SQL server

Requirement

I need a script (vb/bat) that can take this URL and resolves the IP. Then take a config file and replace a placeholder with that IP. The idea is that the config file will always point to the correct IP.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

听风吹 2024-09-14 01:45:34

在大多数配置文件中,您可以使用基于 IP 或基于 FQDN 的方法来定位/连接到您的服务器。如果您的 IP 正在变化(即动态),请尝试用 FQDN 代替 IP 地址,以便 DNS 为您解析 SQL 服务器。

In most configuration files, you can either use an IP based or FQDN based approach to locating/connecting to your server. If your IP is changing (ie dynamic), try placing the FQDN in place of the IP address so that DNS will do the resolution for you to your SQL server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文