php构建dns请求包,用于检索DNS记录的PHP包

Retrieve DNS records

68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f646e732e7376673f7374796c653d666c61742d73717561726568747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7370617469652f646e732f6d61737465722e7376673f7374796c653d666c61742d73717561726568747470733a2f2f7374796c6563692e696f2f7265706f732f3130383831303431392f736869656c643f6272616e63683d6d617374657268747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7370617469652f646e732e7376673f7374796c653d666c61742d73717561726568747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f646e732e7376673f7374796c653d666c61742d737175617265

This package contains a class that can fetch DNS records.

$dns = new Spatie\Dns\Dns('spatie.be');

$dns->getRecords(); // returns all available dns records

$dns->getRecords('A'); // returns only A records

Support us

Learn how to create a package like this one, by watching our premium video course:

f5a7e6def3c8cda25268f7b20310a1b9.png

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

If you do not have dig installed you will need it.

You can install the package via composer:

composer require spatie/dns

Usage

The class can get these record types: A, AAAA, CNAME, NS, SOA, MX, SRV, TXT, DNSKEY, CAA, NAPTR.

$dns = new Spatie\Dns\Dns('spatie.be');

$dns->getRecords(); // returns all records

$dns->getRecords('A'); // returns only A records

$dns->getRecords('MX'); // returns only MX records

$dns->getRecords('A', 'MX'); // returns both A and MX records

$dns->getRecords(['A', 'MX']); // returns both A and MX records

You can get records from a specific nameserver.

$dns = new Spatie\Dns\Dns('spatie.be', 'ns1.openminds.be'); // use ns1.openminds.be

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

We publish all received postcards on our company website.

Credits

License

The MIT License (MIT). Please see License File for more information.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值