diff --git a/README.md b/README.md index 11d654d..43943f6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ -# Dns over HTTPS +# Dns over HTTPS (DOH) -Use parsing from https://github.com/yswery/PHP-DNS-SERVER/ +Currently, implements _Google_ and _CloudFlare_ doh + +## Files +- `www/doh-cli.php` for one time cli answers +- `www/resolve.php` for server - by default listening on _udp://127.0.0.1:5353_ + +## Notes + +This project use low level parsing classes from https://github.com/yswery/PHP-DNS-SERVER/ (_lib/_ folder) diff --git a/composer.json b/composer.json index 1e07185..b7da875 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "dan/dns", + "name": "solcloud/dns", "require": { "php": "7.4.*", "solcloud/curl": "^1.1", diff --git a/www/doh-cli.php b/www/doh-cli.php index 7f552c7..2328950 100644 --- a/www/doh-cli.php +++ b/www/doh-cli.php @@ -9,11 +9,11 @@ function dd(string $msg, int $errorCode = 1): void } if ($argc < 2) { - dd("Usage: $argv[0] domain.name [ google | cloudflare ]"); + dd("Usage: $argv[0] domain.name [ google* | cloudflare ]"); } -$domain = (string)$argv[1] . '.'; -if (($argv[2] ?? 'default' === 'cloudflare')) { +$domain = $argv[1] . '.'; +if (($argv[2] ?? 'default') === 'cloudflare') { $doh = new CloudFlareDoh(); } else { $doh = new GoogleDoh();