ngfw / dnsdumpster
A Laravel package to fetch DNS reconnaissance data from the DNSDumpster API, easily installable via Composer and configurable as a service provider.
Requires
- php: ^7.4|^8.0
Requires (Dev)
- orchestra/testbench: ^9.9
- phpunit/phpunit: ^10.5.35 || ^11.3.6
This package is auto-updated.
Last update: 2025-02-08 06:46:45 UTC
README
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.
Installation
Install the package using Composer:
composer require ngfw/dnsdumpster
The package will automatically register the service provider.
Configuration
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.
Usage
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');
Rate Limiting
The package includes built-in rate-limiting logic to prevent exceeding the API’s limit of 1 request per 2 seconds.
Pagination
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.
Changelog
Refer to the CHANGELOG for details on recent changes.
Contributing
Contributions are welcome! Please see CONTRIBUTING for guidelines.
Credits
License
This package is open-sourced software licensed under the MIT License.