SetHosts


Definition

Set host records for a domain name.

Usage

Use this command to change the host records for a domain name.

This command deletes the existing host records before replacing them with the host records included in the query string. To avoid unpleasant surprises for the user, some resellers use the GetHosts command to retrieve existing host records, and populate the SetHosts query string with existing host records while also allowing the user to add or delete host records.

To set SRV records, use the SetDomainSRVHosts command.

To enable or disable email, use the ServiceSelect command.

Availability

All resellers have access to this command.

Implementation on eNom.com

Log on to resellertest.enom.com with Login ID resellid, password resellpw.

https://resellertest.enom.com/domains/HostConfig.asp?DomainNameID=152533676

On the host settings page, the save changes button calls the SetHosts command.

Constraints

The query must meet the following requirements:

  • The login ID and password must be valid.
  • The domain name must belong to this account.
  • This command deletes your existing host records before replacing them with the records you include in the query string. See Usage note, above.

Input parameters

Build the query string using this syntax:

https://resellertest.enom.com/interface.asp?
command=nameofcommand&uid=yourloginid&pw=yourpassword &paramname=paramvalue&nextparamname=nextparamvalue

 

Parameter Status Description Max Size
UID Required Account login ID 20
PW Required Account password 20
SLD Required Second-level domain name (for example, enom in enom.com) 63
TLD Required Top-level domain name (extension) 15
HostNameX
X=1 to maximum 50
Required Name of the host record to add. This command deletes all existing host records and replaces them with the records you supply in this query string. Index the parameters for each host record X; X must be numeric and in sequence beginning with 1. 60
RecordTypeX
X=1 to maximum 50
Required Record type of host record X. Permitted values are:
A IP address
AAAA IPv6 address
CNAME Alias record type, to associate a host name
URL URL redirect
FRAME Frame redirect
MX Mail. Can be a host name under this domain name or the name of a mail
MXE Mail Easy (email forwarding)
TXT Text (SPF) record
5
AddressX
X=1 to maximum 50
Required Address to redirect to.
If RecordTypeX=A, AddressX must be an IP address
If RecordTypeX=AAAA, AddressX must be an IPv6 address
If RecordTypeX=CNAME, AddressX must be a fully qualified domain name (see Note) or a host name defined in this domain
If RecordTypeX=URL, AddressX must be the exact URL of the page you redirect to, or an IP address, or a fully qualified domain name (see Note)
If RecordTypeX=FRAME, AddressX is the actual URL, or the IP address, or the fully qualified domain name (see Note) of the page you want to display when someone types Your_Domain.com
If RecordTypeX=MX, AddressX must be a fully qualified domain name (see Note) or a host name defined in this domain
If RecordTypeX=MXE, AddressX must be an IP address
If RecordTypeX=TXT, AddressX is a text (SPF) record.
For help writing an SPF record, go to http://spf.pobox.com/wizard.html
260
MXPrefX
X=1 to maximum 50)
Optional; use with record type MX; default is 10 Host record preference for setting mail redirection. The lower the number, the higher the priority 5
ResponseType Optional Format of response. Permitted values are Text (default), HTML, or XML. 4

 

Returned parameters and values

Parameter Description
Command Name of command executed
ErrCount The number of errors if any occurred. If greater than 0, check the Err(1 to ErrCount) values.
ErrX Error messages explaining the failure. These can be presented as-is back to the client.
Done True indicates this entire response has reached you successfully.

 

Notes

  • A fully qualified domain name is expressed in the format “hostname.SLD.TLD.”. Note that the period at the end is an essential component of a fully qualified domain name.
  • The default response format is plain text. To receive the response in HTML or XML format, send ResponseType=HTML or ResponseType=XML in your request.
  • Check the return parameter ErrCount. If greater than 0, the transaction failed. The parameter Err(ErrCount) can be presented to the client. Otherwise, process the returned parameters as defined above.
  • On executing this command, the MX records are not deleted. But all other hosts are deleted and re-created as required.

Example