Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme #1

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,50 @@ Support [PSR-6: Caching Interface](https://www.php-fig.org/psr/psr-6/).
## Requirements

- `Php 8.1` or later
- Function `focksopen` enabled & allowed outbond connection to port `53`
- Function `focksopen` enabled & allowed outbound connection to port `53`
- Network Connectivity (_Absolutely!_)

## Installing

Currently, in development:

```bash
composer require arrayaccess/dns-client:dev-main
composer require arrayaccess/dns-client
```

## Usage

```php
use ArrayAccess\DnsRecord\Cache\Adapter\Psr6CacheAdapter;
use ArrayAccess\DnsRecord\DnsServerStorage;use ArrayAccess\DnsRecord\Resolver;

$cache = new Psr6CacheAdapter();
// $cache->setCacheItemPool($cacheProvider);
$dnsServer = DnsServerStorage::createDefault();
$resolver = new Resolver($dnsServer, $cache);

/**
* Lookup Single
*/
$useCache = true; // default to true
$timeout = 3.5; // 3.5 seconds
$response = $resolver->lookup('domainname.ext', 'A', 'IN', $timeout, $useCache);

/**
* Enable Pseudo OPT
*/
$resolver->setDnsSec(true);
$response = $resolver->lookup('domainname.ext', 'A', 'IN');
$answers = $response->getAnswers();
$records = $answers->getRecords();
// Filter "A" Address Only
$arrayA = $records->getFilteredType('A');

```

> IXFR & AXFR not yet implemented


## Note

The [RRTypes](src/ResourceRecord/RRTypes) not completed yet,
Expand Down