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

AbandonedLibrary

uptimeproject/dns
=================

DNS Resolving in PHP

1.3.0(5y ago)55.0k3[1 issues](https://github.com/uptimeproject/dns/issues)[1 PRs](https://github.com/uptimeproject/dns/pulls)MITPHPPHP ^7.4|^8.0CI failing

Since May 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/uptimeproject/dns)[ Packagist](https://packagist.org/packages/uptimeproject/dns)[ RSS](/packages/uptimeproject-dns/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (8)Versions (10)Used By (0)

[![](https://camo.githubusercontent.com/b0dce0d39540f863d74b952b787170bd58330e8d06173914fe46a72cadf14b98/68747470733a2f2f757074696d6570726f6a6563742e696f2f696d672f6c6f676f2e706e67)](https://uptimeproject.io)

[![Codecov](https://camo.githubusercontent.com/abddcc28d319870c66428f5ffe927456e5b7bd5e34f8f051ac960d68d5559556/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f757074696d6570726f6a6563742f646e733f7374796c653d666c61742d737175617265)](https://app.codecov.io/gh/uptimeproject/dns)[![GitHub Workflow Status](https://camo.githubusercontent.com/6472fc4dc1c77125871be0e987bb234fc9b9d4197f5c8ecab1e879c79856bc05/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f757074696d6570726f6a6563742f646e732f43493f7374796c653d666c61742d737175617265)](https://github.com/uptimeproject/dns/actions)[![Packagist PHP Version Support](https://camo.githubusercontent.com/6fcbb41ac93a3baf56199ca3d0d1ff80b2561843aa71e55e6f05fa57264f7fd9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f757074696d6570726f6a6563742f646e733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/uptimeproject/dns)[![Packagist PHP Version Support](https://camo.githubusercontent.com/0e63d880387fea03ad59e7741bf5c3bccb451a7ee6a27d4916c18f237e8e0aab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f757074696d6570726f6a6563742f646e733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/uptimeproject/dns)[![Packagist Downloads](https://camo.githubusercontent.com/f38a841019cbec0574042491de2cc5a1507995b404c1dd7fea4eb25b0c3e3216/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f757074696d6570726f6a6563742f646e733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/uptimeproject/dns)

This tool is meant as a replacement for `dns_get_record` with some extra functionality.

Mainly, it adds the ability to specify a custom nameserver through which to resolve records.

How to use
----------

[](#how-to-use)

```
composer require uptimeproject/dns
```

```
$resolver = new \UptimeProject\Dns\DnsResolver;

$records = $resolver->resolve('example.com', 'A', 'ns.example.com');

foreach ($records as $record) {
    echo "The {$record->getType()} record for {$record->getName()} resolves\n";
    echo "to {$record->getContent()} with a TTL of {$record->getTTL()} seconds.\n";
}
```

Specifying the nameserver is optional.

As it is built on top of [spatie/dns](https://github.com/spatie/dns) this tool is inherently built on `dig`. Make sure you have dig installed, otherwise you cannot use this package!

How to contribute
-----------------

[](#how-to-contribute)

Feel free to create a PR if you have any ideas for improvements. Or create an issue.

- When adding code, make sure to add tests for it (phpunit).
- Make sure the code adheres to our coding standards (use php-cs-fixer to check/fix).
- Also make sure PHPStan does not find any bugs.

```
vendor/bin/php-cs-fixer fix

vendor/bin/phpstan analyze

vendor/bin/phpunit --coverage-text

phpdbg -qrr vendor/bin/infection
```

These tools will also run in GitHub actions on PR's and pushes on main.

UptimeProject.io
----------------

[](#uptimeprojectio)

Check out [uptimeproject.io](https://uptimeproject.io)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~40 days

Recently: every ~6 days

Total

9

Last Release

1867d ago

Major Versions

0.2.0 → 1.0.02020-05-18

PHP version history (2 changes)0.1.0PHP ^7.1

1.2.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16303480?v=4)[Jesse Kramer](/maintainers/FrontEndCoffee)[@FrontEndCoffee](https://github.com/FrontEndCoffee)

---

Top Contributors

[![FrontEndCoffee](https://avatars.githubusercontent.com/u/16303480?v=4)](https://github.com/FrontEndCoffee "FrontEndCoffee (66 commits)")

---

Tags

digdnshacktoberfestphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[remotelyliving/php-dns

A php library for abstracting DNS querying

164278.4k1](/packages/remotelyliving-php-dns)[rogierw/rw-acme-client

LetsEncrypt client library for ACME v2 written in PHP.

5923.5k1](/packages/rogierw-rw-acme-client)[astrotomic/laravel-dns

327.4k](/packages/astrotomic-laravel-dns)[sun-asterisk/laravel-domain-verify

Verify domain ownership for Laravel application

201.1k](/packages/sun-asterisk-laravel-domain-verify)

PHPackages © 2026

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