A Laravel package for fetching and managing DNS reconnaissance data using the DNSDumpster API. This package simplifies integration with the API, enabling you to query domain-related data directly within your Laravel application.
Install the package using Composer:
composer require ngfw/dnsdumpster
The package will automatically register the service provider.
Publish the configuration file:
php artisan vendor:publish --tag=dnsdumpster-config
Add the required environment variables to your .env
file:
DNSDumpster_API_KEY=your_api_key
DNSDumpster_API_URL=https://api.dnsdumpster.com
You can obtain your key here: dnsdumpster api
Alternatively, you can provide the API key and URL dynamically when instantiating the class.
Here’s how you can fetch domain data using this package:
- Using the Facade-like Access via App::make() or resolve():
use Illuminate\Support\Facades\App;
$dnsDumpster = App::make('DNSDumpster');
// or
$dnsDumpster = resolve('DNSDumpster');
// Use the service
$data = $dnsDumpster->fetchData('gm-sunshine.com');
- Using Dependency Injection
namespace App\Http\Controllers;
use Ngfw\DNSDumpster\DNSDumpster;
use Illuminate\Http\JsonResponse;
class DomainController extends Controller
{
private DNSDumpster $dnsDumpster;
public function __construct(DNSDumpster $dnsDumpster)
{
$this->dnsDumpster = $dnsDumpster;
}
public function lookup(string $domain): JsonResponse
{
$data = $this->dnsDumpster->fetchData($domain);
return response()->json($data);
}
}
- Using the
app()
Helper
$dnsDumpster = app('DNSDumpster');
$data = $dnsDumpster->fetchData('gm-sunshine.com');
The package includes built-in rate-limiting logic to prevent exceeding the API’s limit of 1 request per 2 seconds.
For domains with more than 200 host records, use pagination to retrieve additional results. Example:
$domainInfoPage2 = $dnsDumpster->fetchData('gm-sunshine.com', 2);
The fetchData
method accepts an optional $page
parameter to specify the page number.
Refer to the CHANGELOG for details on recent changes.
Contributions are welcome! Please see CONTRIBUTING for guidelines.
This package is open-sourced software licensed under the MIT License.