PHPackages                             utopia-php/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. [Framework](/categories/framework)
4. /
5. utopia-php/dns

ActiveLibrary[Framework](/categories/framework)

utopia-php/dns
==============

Lite &amp; fast micro PHP DNS server abstraction that is \*\*easy to use\*\*.

1.6.6(1mo ago)696.0k↓18.7%[2 PRs](https://github.com/utopia-php/dns/pulls)1MITPHPPHP &gt;=8.3

Since Feb 23Pushed 1mo ago6 watchersCompare

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

READMEChangelog (10)Dependencies (16)Versions (64)Used By (1)

Utopia DNS
==========

[](#utopia-dns)

[![Tests](https://github.com/utopia-php/dns/actions/workflows/tests.yml/badge.svg)](https://github.com/utopia-php/dns/actions/workflows/tests.yml)[![Packagist Version](https://camo.githubusercontent.com/7f6f21d06d86599b19a3a41886994da2b6a6cff6c70f8ae22cda3604a2d8a636/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f75746f7069612d7068702f646e732e737667)](https://packagist.org/packages/utopia-php/dns)[![Packagist Downloads](https://camo.githubusercontent.com/2cb3303b47cf87f853a9990d9b23a763a322aecb172bdf243e3673bf531c1814/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f75746f7069612d7068702f646e732e737667)](https://camo.githubusercontent.com/2cb3303b47cf87f853a9990d9b23a763a322aecb172bdf243e3673bf531c1814/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f75746f7069612d7068702f646e732e737667)[![Discord](https://camo.githubusercontent.com/b130cc39f0cd917f3fc3e9f94c08a8ba302c8b36d32d8914f5494c473a7070e6/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f353634313630373330383435313531323434)](https://appwrite.io/discord)

Utopia DNS is a modern PHP 8.3 toolkit for building DNS servers and clients. It provides a fully-typed DNS message encoder/decoder, pluggable resolvers, and telemetry hooks so you can stand up custom authoritative or proxy DNS services with minimal effort.

Although part of the [Utopia Framework](https://github.com/utopia-php/framework) family, the library is framework-agnostic and can be used in any PHP project.

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

[](#installation)

```
composer require utopia-php/dns
```

The library requires PHP 8.3+ with the `ext-sockets` extension. The Swoole adapter additionally needs the `ext-swoole` extension.

Quick start
-----------

[](#quick-start)

Create an authoritative DNS server by wiring an adapter (UDP socket implementation) and a resolver (how records are answered). The example below uses the native PHP socket adapter and the in-memory zone resolver.

```
