{"id":15286618,"url":"https://github.com/johnnymast/redbox-dns","last_synced_at":"2025-06-28T05:33:06.278Z","repository":{"id":62534174,"uuid":"55987183","full_name":"johnnymast/redbox-dns","owner":"johnnymast","description":"Quickly retrieve any type of DNS record you wish using PHP","archived":false,"fork":false,"pushed_at":"2017-09-10T11:58:32.000Z","size":23,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T03:40:12.264Z","etag":null,"topics":["composer","dns-record","dns-resolver","php","service"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnnymast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-11T16:04:53.000Z","updated_at":"2024-12-13T20:19:18.000Z","dependencies_parsed_at":"2022-11-02T15:15:20.232Z","dependency_job_id":null,"html_url":"https://github.com/johnnymast/redbox-dns","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/johnnymast/redbox-dns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnymast%2Fredbox-dns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnymast%2Fredbox-dns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnymast%2Fredbox-dns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnymast%2Fredbox-dns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnnymast","download_url":"https://codeload.github.com/johnnymast/redbox-dns/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnymast%2Fredbox-dns/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262381959,"owners_count":23302256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","dns-record","dns-resolver","php","service"],"created_at":"2024-09-30T15:17:44.110Z","updated_at":"2025-06-28T05:33:06.251Z","avatar_url":"https://github.com/johnnymast.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/johnnymast/redbox-dns.svg?branch=master)](https://travis-ci.org/johnnymast/redbox-dns)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/johnnymast/redbox-dns/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/johnnymast/redbox-dns/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/johnnymast/redbox-dns/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/johnnymast/redbox-dns/?branch=master)\n[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social\u0026label=Contact%20author)](https://twitter.com/intent/tweet?text=@mastjohnny)\n\n# Redbox-dns\n\nRedbox-dns can be used to quickly query dns records a given domain. The API it self is extremely easy to use but you can always check out the [examples](https://github.com/johnnymast/redbox-dns/tree/master/examples) directory for some examples.\n\n\n\n# Examples\n\nIn the examples directory you find usecases on how you can this class. Below you find an extremely easy way of receiving the mx records for Google.com and print them out. You can find this example once again in the examples directory.\n\n\n```php\n$resolver = new \\Redbox\\DNS\\Resolver();\n$resolver-\u003eresolve('google.com', DNS_MX);\n\nforeach($resolver as $record) {\n    if ($record['type'] == 'MX')\n        echo $record['type'] . ' ' . $record['pri'] . ' '. $record['target'].\"\\n\";\n};\n```\n\n***ouput***\n```bash\n$ php ./mxrecords.php\nMX 30 alt2.aspmx.l.google.com\nMX 20 alt1.aspmx.l.google.com\nMX 40 alt3.aspmx.l.google.com\nMX 50 alt4.aspmx.l.google.com\nMX 10 aspmx.l.google.com\n\n```\n\n# Resolve Options\n\nThe second parameter to the resolve method can be used to define the desired record type to return. Below is a list of the available record types.\n\n\n| Type       | Record Type   | Description                                                      |\n|:-----------|:--------------| :----------------------------------------------------------------|\n| DNS_ALL    | ALL           | Iteratively query the name server for each available record type |\n| DNS_A      | A             | IPv4 Address Resource                                            |\n| DNS_CNAME  | CNAME         | Alias (Canonical Name) Resource                                  |\n| DNS_HINFO  | HINFO        | Host Info Resource                                                |\n| DNS_MX     | MX            | Mail Exchanger Resource                                          |\n| DNS_NS     | NS            | Authoritative Name Server Resource                               |\n| DNS_PTR    | PTR           | Pointer Resource (Reverse DNS)                                   |\n| DNS_SOA    | SOA           | Start of Authority Resource                                      |\n| DNS_TXT    | TXT           | Text Resource                                                    |\n| DNS_AAAA   | AAAA          | Pv6 Address Resource                                             |\n| DNS_SRV    | SRV           | Service record (SRV record)                                      |\n| DNS_NAPTR  | NAPTR         | Name Authority Pointer                                           |\n\n***Example: Retrieve all CNAME records***\n```php\n/* retreive all CNAME records */\n$resolver-\u003eresolve('google.com', DNS_CNAME);\n```\n\n## Installation\n\nUsing [composer](https://getcomposer.org/):\n\n```bash\n$ composer require redbox/dns\n```\n\n## Installation trough archive download\n\nIf you download the package from a website (for example [github.io](https://github.com/johnnymast/redbox-dns/) or [phpclasses.org](http://www.phpclasses.org/package/9719-PHP-Quickly-retrieve-any-type-of-DNS-record-you-wish.html) or any other) you will need composer installed on your machine.\nThe reason for this is that Redbox-dns comes without the require vendor directory which is required to run the package.\n\nFirst of all if you don't have composer installed you can find it [here](https://getcomposer.org/) follow the instructions and don't get intimidated in fact its really really easy to install.\n\nIn the this sample i will assume you have composer installed (on any machine). Go to the package root (where composer.json is located) and execute the following command.\n\n```bash\n$ composer install  --no-dev\n```\n\n\n## Unit Testing\n\nRedbox-dns comes with a suite of tests that you can run. The tests will be automaticaly run on\n[trevis-ci.com](https://travis-ci.org/johnnymast/redbox-dns) and inspected on [scrutinizer-ci.com](https://scrutinizer-ci.com/g/johnnymast/redbox-dns/?branch=master).\n\n## Requirements\n\nThe following versions of PHP are supported by this version.\n\n+ PHP 5.4\n+ PHP 5.5\n+ PHP 5.6\n+ PHP 7.0\n+ PHP 7.1\n+ HHVM\n \n## License\n\nRedbox-dns is released under the MIT public license.\n\n[LICENSE](https://github.com/johnnymast/redbox-dns/blob/master/LICENSE.md)\n\n## Author\n\nThis package is created and maintained by [Johnny Mast](https://github.com/johnnymast). If you have any questions feel free to contact me on twitter by using [@mastjohnny](https://twitter.com/intent/tweet?text=@mastjohnny) in your tweet.\n \n## Enjoy\n\nOh and if you've come down this far, you might as well [follow me](https://twitter.com/mastjohnny) on twitter.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnymast%2Fredbox-dns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnnymast%2Fredbox-dns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnymast%2Fredbox-dns/lists"}