/go/nameservers: nameservers from the Command Line

/go/nameservers tells GoAdmio which nameservers this server uses when it hosts DNS for your domains with BIND. It: With return, it only prints the saved list. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Use ns1 and ns2 of your own domain
/go/nameservers ns1.example.com ns2.example.com

Arguments

Position Name Required Notes
1 <ns1> Yes The first nameserver hostname, such as ns1.example.com. Its domain, example.com here, gets its own zone.
2 [ns2] No The second nameserver. Most registrars require at least two.
3 [ns3] No
4 [ns4] No
1 return — Instead of setting anything, print the saved list.

Running the command with no arguments exits silently with status 1. The hostnames are not checked.

Examples

# Two nameservers
/go/nameservers ns1.example.com ns2.example.com

# Four nameservers
/go/nameservers ns1.example.com ns2.example.com ns3.example.com ns4.example.com

# Show the saved nameservers
/go/nameservers return

# Check what the server answers for a domain
dig NS example.com @127.0.0.1 +short

Output

Setting nameservers

Nameservers changed to:
ns1.example.com
ns2.example.com

All four lines are printed, so unused nameservers appear as empty lines. The output of zone follows.

The return option

The saved nameservers are printed on one line, separated by |:

ns1.example.com|ns2.example.com||

Unused nameservers leave empty fields, so a list of two ends with ||. If /etc/nameservers does not exist, nothing useful is printed.

Exit codes

Situation Exit code
No arguments 1, no message
return Always 1
Setting nameservers The status of the last step

Every call is also appended to /var/log/go/nameservers.log.

See the full reference at /go/nameservers 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 *