自动更新配置文件中 IP 的脚本
问题
我有一个具有动态 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在大多数配置文件中,您可以使用基于 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.