douyasihefu6214 2010-05-25 18:54
浏览 48
已采纳

不使用PECL或system()类型函数,有没有办法使用PHP查找DNS记录?

I'm working on creating a new type of email protocol, and in order to do that I had to set up an SRV DNS record for my domain.

In promoting this protocol, I'll need to be able to discover if a given host uses my system (and if not fall back to an older protocol).

So, is there a way to pull a DNS record (such as SRV) using PHP without using a PECL extension or running it through the linux command line (I already know I can ob_start() and system("host -t SRV hostname") but I'm looking for a better way, if it exists.)

  • 写回答

2条回答 默认 最新

  • duannong1801 2010-05-25 18:55
    关注

    Use dns_get_record

    array dns_get_record  (  string $hostname  [,  int $type = DNS_ANY  [,  array &$authns  [,  array &$addtl  ]]] )
    

    Fetch DNS Resource Records associated with the given hostname.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比