DNS API commands

DNS API

The following documentation is officially supported by DreamHost. However, if you find any instructions in this article do not function as intended, it's possible it may be out of date. When in doubt, please contact support for further assistance.

The DNS API module allows you to manage Domain Name Service records.

Commands

dns-list_records

Dump a list of all DNS records for all domains (not including registrations) on all accounts you have access to. Please note that this skips the dreamhosters.com, dreamhost.com, dreamhostps.com, and newdream.net zones.

Command dns-list_records
Values (none)
Result

success
account_id zone record type value comment editable
1 718apts.com 718apts.com A 1.2.3.4 0
1 718apts.com 718apts.com MX 0 mx1.balanced.dreamhost.com. 0
1 718apts.com 718apts.com MX 0 mx2.balanced.dreamhost.com. 0
1 718apts.com 718apts.com NS ns1.dreamhost.com. 0
1 718apts.com 718apts.com NS ns2.dreamhost.com. 0
1 718apts.com 718apts.com NS ns3.dreamhost.com. 0
1 718apts.com test.718apts.com CNAME ghs.google.com. A test I did. 1

Possible values type : A,MX,NS,CNAME,PTR,NAPTR,TXT,SRV,SPF,AAAA, or A6

editable : 0 or 1

Possible errors (none)

dns-add_record

Adds a new DNS record to a domain you already have hosted with DreamHost. However, you cannot add dreamhosters.com records. Keep in mind DNS changes may take a while to propagate.

Command dns-add_record
Values record : The full name of the record you'd like to add, e.g., testing.groo.com

type : A,CNAME,NS,PTR,NAPTR,SRV,TXT,SPF, or AAAA value : The DNS record's value. comment : Optional comment for this record.

Result

success
record_added

Possible errors

no_record
no_type
no_value
invalid_record (may have specifics after a tab)
invalid_type (may have specifics after a tab)
invalid_value (may have specifics after a tab)
no_such_zone
CNAME_must_be_only_record
CNAME_already_on_record
record_already_exists_not_editable
record_already_exists_remove_first
internal_error_updating_zone
internal_error_could_not_load_zone
internal_error_could_not_add_record

dns-remove_record

Removes an existing editable DNS record you have with DreamHost. However, you cannot remove dreamhosters.com records. Keep in mind DNS changes may take a while to propagate.

Command dns-remove_record
Values

record : The full name of the record you'd like to remove, e.g., testing.groo.com
type : The type (see dns-add_record) of the record you'd like to remove.
value : The value (see dns-add_record) of the record you'd like to remove.

Result

success
record_removed

Possible errors

no_record
no_type
no_value
no_such_record
no_such_type
no_such_value
not_editable
internal_error_could_not_destroy_record
internal_error_could_not_update_zone

See also

 

Did this article answer your questions?

Article last updated .