Skip to content

About

PanelAlpha sample module for building custom external DNS server integrations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

PanelAlpha Logo

Gain Advantage With Full WordPress Automation


Sample DNS Server Integration

About

The Sample DNS Server Integration provides a sample implementation of an external DNS server integration in PanelAlpha. It follows the same architecture as built-in integrations such as Cloudflare (Zone + Zone/Record) with direct API calls for record operations.

Supported features

  • Connection
    • Test connection
    • Connection config fields (API URL, API key, nameservers)
    • Server-side zone search
  • Zones
    • List zones
    • Find zone
    • Search zones
    • Check zone exists
    • Create zone
    • Delete zone
    • Get zone details
  • DNS records
    • List records
    • Create record
    • Update record
    • Delete record
    • Supported types: A, AAAA, CNAME, MX, TXT, SRV, NS, PTR, CAA, and more (see Zone/Record.php)
  • Nameservers
    • Static nameservers from connection config

Replace the built-in sampleAPI() mock with your real API client to connect to your DNS provider.

File structure

app/Lib/Integrations/DnsServers/
├── SampleDnsServer.php          # Main integration class
└── SampleDnsServer/
    ├── Zone.php                 # Zone operations + listRecords()
    └── Zone/
        └── Record.php           # Record create / update / delete

Creating and installing your own integration

  1. Download the sample
    Clone or download this repository as a base template.

  2. Apply required changes
    Replace every SampleDnsServer reference with your integration name, e.g.:

    • rename app/Lib/Integrations/DnsServers/SampleDnsServer.php to MyDnsProvider.php
    • replace class SampleDnsServer with class MyDnsProvider in that file
    • rename directory app/Lib/Integrations/DnsServers/SampleDnsServer to MyDnsProvider
    • update namespaces App\Lib\Integrations\DnsServers\SampleDnsServer to MyDnsProvider in:
      • MyDnsProvider/Zone.php
      • MyDnsProvider/Zone/Record.php
    • update $name, $slug, and $documentationUrl static properties
  3. Upload the integration
    Copy the contents of the app directory to /opt/panelalpha/app/packages/api/app on your PanelAlpha server.

  4. Activate the integration
    Run as root on the server:

    docker compose -f /opt/panelalpha/app/docker-compose.yml exec api php artisan integrations:sync
    
  5. Replace example code with your own
    Replace sampleAPI() with your real API client factory. Pass connection config from the constructor and testConnection(), then implement zone and record methods used in Zone.php and Zone/Record.php (getZones, findZone, searchZones, getZone, createZone, deleteZone, listRecords, createRecord, updateRecord, deleteRecord).

License

This repository is licensed under the MIT License.

About

PanelAlpha sample module for building custom external DNS server integrations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages