duanqiang7631 2018-10-17 21:39
浏览 62
已采纳

checkdnsrr无法找到我的域名,而dns_get_record可以找到它

I am trying to use two different functions to validate the domain/host names

when I use

checkdnsrr(end($domainname)) 

I get none or false response.

but when I use

dns_get_record(end($domainname)) 

I get my domain listed and true response

will checkdnsrr use different method to resolve hostnames?

  • 写回答

1条回答 默认 最新

  • douba9425 2018-10-17 21:53
    关注

    The default record type for checkdnsrr() is "MX".

    The default type for dns_get_record() is DNS_ANY.

    If your domain doesn't have an MX record, you'll get an empty response from the first call. The second call will find whatever records are available for the domain.

    What you're more likely to be interested in are A records, which contain the site's IPv4 address. Try

    checkdnsrr(end($domainname), "A")
    dns_get_record(end(domainname), DNS_A)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 python中transformers可以正常下载,但是没有办法使用pipeline
  • ¥50 分布式追踪trace异常问题
  • ¥15 人在外地出差,速帮一点点
  • ¥15 如何使用canvas在图片上进行如下的标注,以下代码不起作用,如何修改
  • ¥15 Windows 系统cmd后提示“加载用户设置时遇到错误”
  • ¥50 vue router 动态路由问题
  • ¥15 关于#.net#的问题:End Function
  • ¥15 无法import pycausal
  • ¥15 weditor无法连接模拟器Local server not started, start with?
  • ¥20 6-3 String类定义