DoH (DNS over HTTPS) PHP Client
Switch branches/tags
Nothing to show
Clone or download
dcid Merge pull request #2 from pedigree/master
POST support options
Latest commit db1fc8d Apr 6, 2018
Failed to load latest commit information.
LICENSE Initial commit Mar 11, 2018 Cleaning up readme to match changes. Apr 3, 2018
doh-php-client.php fixed the GET on experimental Apr 3, 2018


DoH (DNS over HTTPS) PHP Client

This is a proof of concept for a DoH (DNS over HTTPS) client in PHP. It is based on the latest draft and supports the GET method with the DNS UDP wire format. This is a work in progress and only the A, AAAA and CNAME records are supported.

MX and NS are coming soon.

It supports CloudFlare's , Google's and CleanBrowsing DoH servers.


This tool should be executed from the command line and it has a similar output as the host command. Example:

 $ php doh-php-client.php 
 Usage: doh-php-client.php [server:cloudflare,google,cleanbrowsing] [] <type: A, AAAA or CNAME>

 $php doh-php-client.php cloudflare has address has address

Or for IPv6:

 $ php doh-php-client.php google AAAA has IPv6 address 2a02:fe80:1010::16

You have to specify as the first argument which DoH server to use. We support "google", "cloudflare" or "cleanbrowsing".


This is just an initial test version. We will be spliting it into a better organized package later.