PHPackages                             danog/libdns-json - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. danog/libdns-json

ActiveLibrary[Queues &amp; Workers](/categories/queues)

danog/libdns-json
=================

Encoder/decoder for google's JSON DNS message format based on libdns

0.2.1(1y ago)7708.7k—1.3%1MITPHPPHP &gt;=8.1

Since Jun 12Pushed 1y agoCompare

[ Source](https://github.com/danog/LibDNSJson)[ Packagist](https://packagist.org/packages/danog/libdns-json)[ Docs](https://github.com/danog/libdns-json)[ RSS](/packages/danog-libdns-json/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (5)Used By (1)

LibDNSJson
==========

[](#libdnsjson)

[![Build Status](https://camo.githubusercontent.com/3580fe884e629103dda6440cef5f7010a07acf2bcfb63cc1bb6d75027420d676/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f64616e6f672f6c6962646e736a736f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/danog/libdnsjson)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)

Encoder/decoder for [google's JSON DNS message format](https://developers.google.com/speed/public-dns/docs/dns-over-https) based on [libdns](https://github.com/DaveRandom/LibDNS/).

The API consists of a `QueryEncoderFactory` that creates `QueryEncoder` objects, that can encode libdns `Message` objects to a query string that can be used both with google's and cloudflare's DNS-over-HTTPS APIs (for cloudflare, using directly UDP wireformat with `libdns`'s `Encoder` is recommended).

The `JsonDecoderFactory` creates `JsonDecoder` objects, that accept JSON strings and decode them back to `Message` objects.

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

[](#installation)

```
composer require danog/libdns-json

```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community8

Small or concentrated contributor base

Maturity61

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

Total

4

Last Release

532d ago

PHP version history (2 changes)0.1PHP &gt;=7.0

0.2.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1586cd637028e4f8da85f2252b8f4b81e05f6b17a93f92c34ff064dd838e6bb?d=identicon)[danog](/maintainers/danog)

---

Top Contributors

[![danog](https://avatars.githubusercontent.com/u/7339644?v=4)](https://github.com/danog "danog (9 commits)")

---

Tags

dnsdohjsonlibdnsmessagehttpsjsondnsdns-over-httpsdohlibdns

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/danog-libdns-json/health.svg)

```
[![Health](https://phpackages.com/badges/danog-libdns-json/health.svg)](https://phpackages.com/packages/danog-libdns-json)
```

###  Alternatives

[php-amqplib/php-amqplib

Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.

4.6k125.3M879](/packages/php-amqplib-php-amqplib)[danog/dns-over-https

Async DNS-over-HTTPS resolution for Amp.

11709.8k7](/packages/danog-dns-over-https)[react/dns

Async DNS resolver for ReactPHP

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

Async DNS resolution for Amp.

19339.2M41](/packages/amphp-dns)[aws/aws-php-sns-message-validator

Amazon SNS message validation for PHP

21421.5M91](/packages/aws-aws-php-sns-message-validator)[phootwork/collection

The phootwork library fills gaps in the php language and provides better solutions than the existing ones php offers.

3924.8M15](/packages/phootwork-collection)

PHPackages © 2026

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