Skip to content
The Laravel client package for LaraDNS - automating the DNS update process.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

LaraDNS - Client

This is the client for users of LaraDNS that exposes a php artisan dns:sync console command which updates the IP address of a particular Cloudflare DNS record with that of the originating request.


As simple as it should be:

Require it

composer require laradns/laravel-client

Configure it

Add your unique ID obtained after adding your site via the LaraDNS interface:

// .env


Add the LaraDNS service provider:

// config/app.php

'providers' => [
    // Other service providers...    

Run it

Schedule the command to execute as often, or as little, as you wish. As it's a console command, you can even include it in your deploy script to ensure your DNS is always up-to-date.

// App/Console/Kernel.php

protected function schedule(Schedule $schedule)


You may wish to perform your own actions on an IP update. To facilitate this, the client fires an LaraDns\Events\SiteUpdated event each time an IP address changes, with the address as the payload.

Register a listener:

// App/Providers/EventServiceProvider.php

protected $listen = [
    \LaraDns\Events\SiteUpdated::class => [

Handle the event:

// App/Listeners/SiteIpUpdated.php


namespace App\Listeners;

class SiteIpUpdated
    public function __construct()
    public function handle(\LaraDns\Events\SiteUpdated $event)
        // $event->newIpAddress;

Help and Contact

Please feel free to contact for any assistance and troubleshooting.

You can’t perform that action at this time.