PHPackages                             frankvanhest/dns-lookup - 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. frankvanhest/dns-lookup

ActiveLibrary

frankvanhest/dns-lookup
=======================

Simple library to retrieve DNS records with default OS resolver or specific nameserver

v1.0.0(2y ago)011.9k↑36.4%3[2 issues](https://github.com/frankvanhest/dns-lookup/issues)MITPHPPHP ~8.1 || ~8.2 || ~8.3CI passing

Since Jun 20Pushed 7mo agoCompare

[ Source](https://github.com/frankvanhest/dns-lookup)[ Packagist](https://packagist.org/packages/frankvanhest/dns-lookup)[ Docs](https://github.com/frankvanhest/dns-lookup)[ GitHub Sponsors](https://github.com/frankvanhest)[ RSS](/packages/frankvanhest-dns-lookup/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (9)Used By (0)

DNS Lookup
==========

[](#dns-lookup)

Simple library to retrieve DNS records using the OS's `dig` command (with default resolver or specific nameserver).

Install
-------

[](#install)

Simple, just use composer

```
composer require frankvanhest/dns-lookup

```

Usage
-----

[](#usage)

For a DNS lookup without a specific nameserver:

```
$dnsLookup = new \FrankVanHest\DnsLookup\DnsLookup('domain.com');

```

For a DNS lookup with a specific nameserver:

```
$dnsLookup = new \FrankVanHest\DnsLookup\DnsLookup('domain.com', '8.8.8.8'); // An IP or domain is allowed

```

Get all available records

```
/** @var \FrankVanHest\DnsLookup\DnsRecord $dnsRecord */
foreach ($dnsLookup->getAllRecords() as $dnsRecord) {
    echo $dnsRecord->getName();
    echo $dnsRecord->getType();
    echo $dnsRecord->getValue();
    echo $dnsRecord->getTtl();
    echo $dnsRecord->getPrio();
}

```

Get all available records of a specific type

```
/** @var \FrankVanHest\DnsLookup\DnsRecord $dnsRecord */
foreach ($dnsLookup->getRecordsByType('A') as $dnsRecord) {
    echo $dnsRecord->getName();
    echo $dnsRecord->getType();
    echo $dnsRecord->getValue();
    echo $dnsRecord->getTtl();
    echo $dnsRecord->getPrio();
}

```

Contribution
------------

[](#contribution)

If you have any contribution for this project feel free to submit a pull request.

License
-------

[](#license)

See [License](LICENSE.md)

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance45

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

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 ~341 days

Recently: every ~508 days

Total

7

Last Release

843d ago

Major Versions

v0.x-dev → v1.0.02024-01-26

PHP version history (4 changes)v0.1.0PHP ^7.2

v0.2.0PHP ^7.1

v0.3.0PHP ^7.1 || ~8

v1.0.0PHP ~8.1 || ~8.2 || ~8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2206481?v=4)[Frank van Hest](/maintainers/FrankVanHest)[@frankvanhest](https://github.com/frankvanhest)

---

Top Contributors

[![frankvanhest](https://avatars.githubusercontent.com/u/2206481?v=4)](https://github.com/frankvanhest "frankvanhest (12 commits)")[![ainesophaur](https://avatars.githubusercontent.com/u/4686198?v=4)](https://github.com/ainesophaur "ainesophaur (1 commits)")[![mend-bolt-for-github[bot]](https://avatars.githubusercontent.com/in/16809?v=4)](https://github.com/mend-bolt-for-github[bot] "mend-bolt-for-github[bot] (1 commits)")[![ThomasLandauer](https://avatars.githubusercontent.com/u/1054469?v=4)](https://github.com/ThomasLandauer "ThomasLandauer (1 commits)")

---

Tags

dnsresolver

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)[dflydev/placeholder-resolver

Given a data source representing key =&gt; value pairs, resolve placeholders like ${foo.bar} to the value associated with the 'foo.bar' key in the data source.

14414.6M3](/packages/dflydev-placeholder-resolver)[mlocati/spf-lib

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

67867.9k2](/packages/mlocati-spf-lib)

PHPackages © 2026

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