Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayIterator committed Nov 11, 2023
1 parent 8eaed35 commit fe45823
Showing 1 changed file with 35 additions and 2 deletions.
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

0 comments on commit fe45823

Please sign in to comment.