Download the PHP package gekkone/php-dns-server without Composer
On this page you can find all versions of the php package gekkone/php-dns-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gekkone/php-dns-server
More information about gekkone/php-dns-server
Files in gekkone/php-dns-server
Package php-dns-server
Short Description Forked from yswery/dns. A DNS server implementation in pure PHP.
License MIT
Informations about the package php-dns-server
PHP DNS Server
This is an Authoritative DNS Server written in pure PHP. It will listen to DNS request on the default port (Default: port 53) and give answers about any domain that it has DNS records for. This class can be used to give DNS responses dynamically based on your pre-existing PHP code.
Requirements
PHP 7.2+
- Needs either
sockets
orsocket_create
PHP extension loaded (which they are by default)
Example
Here is an example of DNS server usage:
Running example
- Run
composer install
to install dependencies - Run
php example/example.php
to run the server
Query server using dig
command to ensure proper functioning
Zone File Storage
PHP DNS Server supports four zone file formats out-of-the-box: Bind, JSON, XML, and YAML; each file format
is supported by a specialised Resolver
class: BindResolver
, JsonResolver
, XmlResolver
, and YamlResolver
,
respectively. Example files are in the example/
directory.
JSON zone example
Running Tests
Unit tests using PHPUnit are provided. A simple script is located in the root.
- run
composer install
to install PHPUnit and dependencies - run
vendor/bin/phpunit
from the root to run the tests
Building .phar
- run
composer run-script build-server
to build the phpdnsserver.phar file, outputs in the bin folder. - run
composer run-script build-console
to build the phpdnscli.phar file, outputs in the bin folder. - run
composer run-script build-installer
to build the installer. Windows support for the installer is currently limited.
Running the .phar files
To run the new .phar files, download them from the release and move them to the desired folder.
phpdnsserver.phar
to run the phpdnsserver, uses the new filesystem by defaultphpdnscli.phar
to run cli commandsphpdnsinstaller.phar
as root to create required folders and default config.
Supported command line switches
--bind:b
- bind to a specific ip. Uses0.0.0.0
by default--port:p
- bind to a specific port. Uses port53
by default--config:c
- specify the config file. Usesphpdns.json
on windows and/etc/phpdns.json
on unix systems by default--storage:s
- specify the path to the storage for zones, and logs. Uses/etc/phpdnsserver
on unix, and current working directory on windows.
Supported Record Types
- A
- NS
- CNAME
- SOA
- PTR
- MX
- TXT
- AAAA
- AXFR
- ANY
- SRV
- CAA (since ver. 1.5.0)
License
The MIT License (MIT)
Copyright (c) 2016-2017 Yif Swery
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
All versions of php-dns-server with dependencies
ext-json Version *
ext-simplexml Version *
badcow/dns Version ^3.4
psr/log Version ^1.0
react/socket Version ~1.2
react/datagram Version ^1.4
symfony/console Version ^4.3
symfony/event-dispatcher Version ^4.3
symfony/filesystem Version ^4.3
symfony/property-access Version ^4.3
vanilla/garden-cli Version ^2.2