PHP 中的 DNS 查找

2022-01-04 00:00:00 windows php dns

我有一台 Windows 服务器,它间歇性地失去了查找 DNS 信息的能力.我正在尝试找出问题的根本原因,但同时我希望能够监控服务器是否可以执行查找.

I have a Windows server that is intermittently losing the ability to lookup DNS information. I'm trying to get to the root cause of the problem but in the mean time I'd like to be able to monitor whether the server can perform lookups.

基本上,它应该尝试查找一些常见的主机名,如果查找成功则显示成功".

Basically, it should attempt to lookup some common hostnames and the display 'Success' if the lookups are successful.

该站点运行 PHP,因此我希望监视器脚本使用 PHP,但如果有人知道如何在 ASP/.Net 中执行此操作,那也可以.

The site runs PHP so I'd prefer that the monitor script be in PHP but if someone knows how to do this in ASP / .Net that would work as well.

推荐答案

http://www.php.net/manual/en/function.dns-get-record.php 是 php 中的函数,听起来像是您在追求.

http://www.php.net/manual/en/function.dns-get-record.php is the function in php it sounds like you are after.

相关文章