Skip to content
Open
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
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,39 @@

A simple way to fetch DNS Resource Records associated with a hostname.

### How to
## How to

Using digger is easy as 1, 2, 3.

<?php
require 'vendor/autoload.php';
```php
<?php
require 'vendor/autoload.php';

use Daniesy\Digger;
use Daniesy\Digger;

$records = (new Digger)->getRecords('ping-pong.dev', 'A');
foreach($records as $record) {
var_dump($record);
}

if($records->has('127.0.0.1')) {
echo "The dns record is set";
}
$records = (new Digger)->getRecords('ping-pong.dev', 'A');
foreach($records as $record) {
var_dump($record);
}

### Installation
if($records->has('127.0.0.1')) {
echo "The dns record is set";
}
```

You can install `Digger` with composer by running the following command.
## Installation

`composer require daniesy/php-digger:dev-master`
You can install `Digger` with composer by running the following command:

### Parameters
```bash
composer require daniesy/php-digger:dev-master
```

## Parameters

- **host**
The host you want to fetch the DNS records from
- **type**
The type of DNS Records you want to get. At the moment, only the following records are supported: `A`, `AAAA`, `CAA`, `CNAME`, `MX`, `NS`, `PTR`, `SOA`, `SRV`, `TXT`. I'll add more at a later point.
- **timeout**
The timeout in seconds after which the call should fail. The default timeout is `5` seconds.
The timeout in seconds after which the call should fail. The default timeout is `5` seconds.