PHPackages                             fhferreira/php-dig - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fhferreira/php-dig

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fhferreira/php-dig
==================

Use servers CLI command dig over php internal dns\_get\_record() function - just a fork of hostinger/php-dig

1.2(1y ago)036.7k↓52.5%MITPHPPHP &gt;=5.6

Since Feb 22Pushed 1y agoCompare

[ Source](https://github.com/fhferreira/php-dig)[ Packagist](https://packagist.org/packages/fhferreira/php-dig)[ RSS](/packages/fhferreira-php-dig/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (2)Versions (72)Used By (0)

php-dig
=======

[](#php-dig)

Introduction
------------

[](#introduction)

[PHP DNS functions](http://php.net/manual/en/ref.network.php) don't have a timeout while the default timeout for dig is 5 seconds (with several (3) tries)

It should drastically decrease time to get dns records, and lower failure errors like `dns_get_record(): A temporary server error occurred.`

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

[](#installation)

Install the latest version with

```
$ composer require fhferreira/php-dig
```

Usage
-----

[](#usage)

```
$client = new Hostinger\DigClient();
$result = $client->getRecord('hostinger.com', DNS_MX);
```

This is equal to

```
dns_get_record('hostinger.com', DNS_MX);
```

Package checks if it can run `exec` in server environment, otherwise it will fallback to dns\_get\_record().

### DigClient implements LoggerAwareInterface

[](#digclient-implements-loggerawareinterface)

You can set [logger](https://github.com/Seldaek/monolog/) to debug / log package activity

```
$client = new Hostinger\DigClient();
$logger = new \Monolog\Logger\Logger('App');
$logger->pushHandler(new StreamHandler('path/to/your.log'));
$client->setLogger($logger);
```

About
-----

[](#about)

### Requirements

[](#requirements)

- php-dig client works with PHP 5.6 or above.

### Submitting bugs and feature requests

[](#submitting-bugs-and-feature-requests)

Bugs and feature request are tracked on [GitHub](https://github.com/hostinger/php-dig/issues)

Sources
-------

[](#sources)

- [Stack overflow question What would cause checkdnsrr() or dns\_get\_record() to take too long?](http://stackoverflow.com/questions/14065946/what-would-cause-checkdnsrr-or-dns-get-record-to-take-too-long)
- [Reddit thread: dns\_get\_record suddenly running very slowly](https://www.reddit.com/r/PHP/comments/2k3ns7/dns_get_record_suddenly_running_very_slowly/)

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance41

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 64.7% 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 ~595 days

Total

3

Last Release

491d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6737936990660260df87570e586c254abe975be9f0a7f3964abf38ed5012b4b7?d=identicon)[fhferreira](/maintainers/fhferreira)

---

Top Contributors

[![vaidas-lungis](https://avatars.githubusercontent.com/u/5111555?v=4)](https://github.com/vaidas-lungis "vaidas-lungis (11 commits)")[![fhferreira](https://avatars.githubusercontent.com/u/140686?v=4)](https://github.com/fhferreira "fhferreira (5 commits)")[![fordnox](https://avatars.githubusercontent.com/u/398619?v=4)](https://github.com/fordnox "fordnox (1 commits)")

---

Tags

dnsdigdns\_get\_record

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fhferreira-php-dig/health.svg)

```
[![Health](https://phpackages.com/badges/fhferreira-php-dig/health.svg)](https://phpackages.com/packages/fhferreira-php-dig)
```

###  Alternatives

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

514139.2M692](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)[logiscape/mcp-sdk-php

Model Context Protocol SDK for PHP

368116.8k12](/packages/logiscape-mcp-sdk-php)

PHPackages © 2026

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