PHPackages                             gemz/dns - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. gemz/dns

ActiveLibrary

gemz/dns
========

Get simply DNS records

1.0.0(6y ago)013.1k1MITPHPPHP ^7.1.3CI failing

Since Apr 18Pushed 6y agoCompare

[ Source](https://github.com/gemzio/dns)[ Packagist](https://packagist.org/packages/gemz/dns)[ Docs](https://github.com/gemzio/dns)[ Patreon](https://www.patreon.com/gemzio)[ RSS](/packages/gemz-dns/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

Get DNS records
===============

[](#get-dns-records)

[![Latest Version on Packagist](https://camo.githubusercontent.com/abcdec96697ac2c5f9df2c5ab43019198e6d781d1489d83ebb588f385b241bf5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656d7a2f646e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gemz/dns)[![GitHub Tests Action Status](https://camo.githubusercontent.com/9ca687b789c568c04f03e98ac197931e954fcbe1108d149743e40269c8703241/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f67656d7a696f2f646e732f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/gemzio/dns/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Quality Score](https://camo.githubusercontent.com/228b162e485cd13eb9c1acf257e7780fed0a704d903c6f48897a4c6b305d3c67/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f67656d7a696f2f646e732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/gemzio/dns)[![Total Downloads](https://camo.githubusercontent.com/4c6f3be9dade7455635c1c9b97f942091efd203b0872ea41661b1c003c0c3eca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67656d7a2f646e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gemz/dns)

Retrieve DNS records for a given domain. Under the hood the package uses for concurrent dns queries.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require gemz/dns
```

Usage
-----

[](#usage)

```
use Gemz\Dns\Dns;

// initialization
$dns = new Dns('gemz.io');
$dns = Dns::for('gemz.io');

// supported record types
// returns ["A", "CAA", "CNAME", "SOA", "TXT", "MX", "AAAA", "SRV", "NS", "PTR", "SSHFP"]
$dns = Dns::for('gemz.io')->allowedRecordTypes();

// get results for all record types
$dns = Dns::for('gemz.io')->records();

 // get result for specific record(s)
$dns = Dns::for('gemz.io')->records(['A', 'CNAME']);
$dns = Dns::for('gemz.io')->records('A', 'MX', 'TXT');

// using a nameserver
$dns = Dns::for('gemz.io')->useNameServer('example.gemz.io')->records();

// sanitizing domain
$domain = Dns::for('https://gemz.io')->getDomain(); // gemz.io

// record type results
$dns = Dns::for('gemz.io')->records('A', 'NS');
// depending on the record type "data" will be a string or an array with different keys
// result is an array in form of:
[
  "A" => [
    ["ttl" => 21599, "data" => ""]
  ],
  "NS" => [
    ["ttl" => 21599, "data" => ""],
    ["ttl" => 21599, "data" => ""],
  ],
  "MX" => [
    ["ttl" => 21599, "data" => ["priority" => 10, "target" => ""]],
    ["ttl" => 21599, "data" => ["priority" => 20, "target" => ""]],
  ]
];
```

### Testing

[](#testing)

```
composer test
composer test-coverage
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Stefan Riehl](https://github.com/stefanriehl)
- [All Contributors](../../contributors)

Support us
----------

[](#support-us)

Gemz.io is maintained by [Stefan Riehl](https://github.com/stefanriehl). You'll find all open source projects on [Gemz.io github](https://github.com/gemzio).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2221d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4265046f24e014f773ad4f7cb289fb27b313d75f2810085462b7bd590d963ebe?d=identicon)[stefanriehl](/maintainers/stefanriehl)

---

Tags

dnsgemz

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gemz-dns/health.svg)

```
[![Health](https://phpackages.com/badges/gemz-dns/health.svg)](https://phpackages.com/packages/gemz-dns)
```

###  Alternatives

[react/dns

Async DNS resolver for ReactPHP

536114.1M100](/packages/react-dns)[amphp/dns

Async DNS resolution for Amp.

19339.2M41](/packages/amphp-dns)[daverandom/libdns

DNS protocol implementation written in pure PHP

16339.1M9](/packages/daverandom-libdns)[spatie/dns

Retrieve DNS records

6082.3M17](/packages/spatie-dns)[mlocati/spf-lib

Parse, build and validate SPF (Sender Policy Framework) DNS records

67867.9k2](/packages/mlocati-spf-lib)[yiisoft/network-utilities

Network related utilities

29503.3k4](/packages/yiisoft-network-utilities)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
