GoAdmio Command Line: zone with /go/zone

/go/zone manages the DNS zones that this server answers for with BIND, the DNS server software. GoAdmio keeps each domain's DNS records in a database. This command: It matters only when this server is the authoritative DNS server for your domains, that is, when the domains' nameservers point at this server. If your DNS is managed at Cloudflare instead, use dns and cloudflare. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Refresh a domain's default DNS records and rewrite its zone file
/go/zone example.com update

Options

Argument Required Notes
domain Yes A hosted domain with a /home/<domain>/www folder, or all. With the main action, the folder isn’t needed.
action No update, reset, main, or delete. With all, only reset and update do anything. Any other value prints Invalid action.
--norestart No Don’t restart BIND at the end. Used when many zones are rebuilt in a row.

[!WARNING]
/go/zone all reset deletes every record in the zone database, including custom records you added yourself, before it rebuilds the defaults. To keep custom records, use all update.

Examples

# Refresh a domain's default records
/go/zone example.com update

# Rewrite a domain's zone file from the saved records
/go/zone example.com

# Create the zone for the domain of your nameservers
/go/zone example.net main

# Remove a zone
/go/zone example.com delete

# Rebuild all zones and keep custom records
/go/zone all update

# Check a zone file for errors (RHEL family path shown)
named-checkzone example.com /etc/zone/example.com

Output

The command prints nothing when it works, except for all, which prints one line for each entry in /home:

Resetting DNS Zone example.com...

Message Meaning
Please Setup a Nameserver. /etc/nameservers doesn’t exist. Exit status 1.
Domain "<domain>" not exists. No /home/<domain>/www folder (and the action isn’t main). Exit status 1.
Invalid action. The action isn’t one of the allowed values. Exit status 1.
named-checkconf messages BIND’s own check of its configuration found a problem.

The command exits with status 1 after delete, and after any all run, even when everything worked.

With all, any action other than reset or update does nothing and ends without a message.

Log

Each run appends one line to /var/log/go/zone.log:

[Nov 21 12:00:00]# zone example.com update

See the full reference at /go/zone and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *