Computing at Cornell Resources for Technical Support Providers

Batch Commands for the DNS Database

To use this interface, create a batch file containing as many commands as you wish, using the format shown in the table below. Upload your completed file to the DNS database batchload interface.

Note: In order to make most of the commands in this list work, you must be registered as NetAdmin for both the subnet (e.g. 128.253.64) and the domain (e.g. bar.cornell.edu). To check whether you are registered, see the list at http://dnsdb.cit.cornell.edu/dnsdb-cgi/netadmin.cgi. You can request changes by writing to hostmaster@cornell.edu.

Command Action
Host Name
addhost hostname ipaddr Creates an A record, the primary DNS entry that associates an alphanumeric hostname with a numeric IP address.
Example: addhost foo1.bar.cornell.edu 128.253.64.250
assigns the hostname foo1.bar.cornell.edu to the computer at the network address 128.253.64.250.
delhost hostname [ipaddr] Deletes DNS' record of the specified hostname and its attributes. This command allows deleting a host that has cnames and mxrecords attached; the cnames and mxrecords are also deleted. There are copious messages indicating what has been done.
Example: delhost foo1.bar.cornell.edu
removes the hostname foo1.bar.cornell.edu. DNS will no longer be able to find either the hostname or the associated IP address.
Example: delhost foo1.bar.cornell.edu 128.253.64.250
removes the hostname and its attributes at the specified IP address.
chghost hostname newipaddr Moves a hostname and its attributes (aliases, hostinfo, MX records and secondary addresses) from its old IP address to the specified new address.
Example: chghost foo1.bar.cornell.edu 128.253.65.253
changes the primary IP address associated with the hostname foo1.bar.cornell.edu to 128.253.65.253.
chgname hostname newname Changes the specified hostname to a new name.
NetID or Guest Code of Owner or User
chgowner hostname NetID Adds an owner (NetID or guest code) to a record.
chgowner hostname Deletes the owner from a record.
MAC Address
addmac ipaddr mac-address Adds a MAC address for hostname. This is used for static IP addressing with DHCP. (A MAC, or Media Access Control, address identifies a particular piece of hardware; often it's the serial number of the ethernet or wireless card.)
chgmac ipaddr mac-address Changes the MAC address for hostname.
delmac ipaddr Deletes the MAC address for hostname.
NUBB
subnet_nubb subnet_ipaddr account Changes the default NUBB account for the subnet at subnet_ipaddr
hostnubb ipaddr account Changes the NUBB account at ipaddr
chgaux ipaddr nubb_descr location CU_serial custom Changes 4 auxiliary values for the host at the specified IP address. nubb_descr is the field called User/Description in NUBB, which is usually filled in with the hostname, while location, CU_serial, and custom are additional fields provided for convenience in keeping track of hosts.
Alias
addcname alias_name hostname Creates a new alias for an existing hostname. A hostname may have up to 9 aliases.
Example: addcname foo3.bar.cornell.edu foo1.bar.cornell.edu makes foo3.bar.cornell.edu an alternate name that people can use to refer to the computer already known by the hostname foo1.bar.cornell.edu
delcname alias_name Removes an alias.
Example: delcname foo3.bar.cornell.edu
means that the name foo3.bar.cornell.edu will no longer be recognized as corresponding to any particular host. The original hostname and other aliases, if any, will continue to work.
Mail Exchange (MX)
addmx hostname
mx_preference mx_exchanger
Adds a mail exchange (MX) record, which is needed if you run your own mail server and don't use CIT's (see What is an MX record?). The addmx command allows adding a dangling mxrecord to a nonexistent host.
Example: addmx foo1.bar.cornell.edu 10 foo2.bar.cornell.edu
delmx hostname mx_exchanger Deletes the MX record associated with the specified hostname
Example: delmx foo1.bar.cornell.edu mx.bar.cornell.edu
Host Info (Hardware and Software Type)
addhinfo hostname hardware opsys Records two pieces of information about the specified hostname: what type of machine it is (for example, Sun or Macintosh) and what operating system it runs (for example, Solaris or MacOS).
Example: addhinfo foo1.bar.cornell.edu Dell Win98
identifies foo1.bar.cornell.edu as a Dell machine running Windows 98.
delhinfo hostname Deletes the host info (machine type and operating system) for the specified hostname.
Example: delhinfo foo1.bar.cornell.edu
removes information recorded by a previous addhinfo command about what type of computer foo1.bar.cornell.edu is and what operating system it runs.
Secondary Address
addaddr hostname ipaddr Adds a secondary address for an existing hostname. DNS will resolve requests for that hostname using a round robin. This can be used for load balancing, for example among mirrored web sites.
Example: addaddr foo1.bar.cornell.edu 128.253.64.252
assigns the secondary IP address 128.253.64.252 to the hostname foo1.bar.cornell.edu, which already has a primary address (assigned with an addhost command).
deladdr hostname ipaddr Deletes the specified secondary address for hostname.
Example: deladdr foo1.bar.cornell.edu 128.253.64.252
TTL (Time to Live)
chgttl hostname ttl Changes the TTL (Time To Live) of a hostname's DNS record (A record), controlling how long the information may be cached by other servers and client computers. TTL is specified in seconds; default is 86400 (1 day). 300 (5 minutes) is a useful setting in preparation for a future change in a host's IP address.
Example: chgttl foo1.abc.cornell.edu 300
changes the DNS record for host 'foo1.abc.cornell.edu' so it can be cached for a maximum of 300 seconds.
chgcnamettl alias_name ttl Changes the TTL for an alias's DNS record (CNAME record).
chgmxttl hostname ttl Changes the TTL for a mail exchange DNS record (MX record).
Windows 2000/2003 Dynamic DNS
add_win_dns domain arecord_name Adds a Windows DNS Server for a domain (see Windows 2000 Dynamic DNS).
del_win_dns domain arecord_name Deletes the Windows DNS Server for a domain.
Display
listhost hostname [ipaddr] Lists all the attributes of the specified hostname--IP address, secondary addresses, aliases, host info and MX records, if any. With the optional IP address specified, displays additional host attributes including machine user, NUBB account, etc.
Example: listhost foo1.bar.cornell.edu
displays the attributes of the hostname foo1.bar.cornell.edu.
listaddr ipaddr Shows the hostname, if any, associated with the given IP address.
Example: listaddr 128.253.64.250 displays the hostname that DNS would currently translate to the IP address 128.253.64.250, assuming an A record exists to associate the specified IP address with a hostname
listmac mac-address Shows IP address, if any, registered with the given MAC address.
Example: listmac 00:01:23:45:6A:BC
Visitor Registration
chgowner hostname email Adds a visitor's e-mail address to the owner field of a host. This can only be done if the host has an expiration date set and information is recorded about the visitor's e-mail address.
Example: chgowner abc.cit.cornell.edu jjdoe@yahoo.com
updatevisitor email name date days unit purpose Records information associated with the e-mail address of a visitor: visitor's name, starting date of the visit, number of days of the visit, Cornell unit, and purpose of the visit.
Example: updatevisitor jjdoe@yahoo.com "John Doe" 6/1/2006 7 "Admin-OIT" "Vendor assisting with server install."
confirmvisitor string With a self-registration confirmation code, lets you confirm a visitor who has self-registered and not yet confirmed. Confirmation codes are e-mailed to users embedded in URLs that allow the users to confirm themselves. It is far more practical for NetAdmins to do such confirmations using the confirmations web page, which allows you to find the user by e-mail address. However, given a confirmation code, this command also lets you confirm visitors.
Example: confirmvisitor 000D9351E3D6557CAABE77795DF4

Short version of this table

DNS Database Top Page |
Host Registration Top Page | Host Registration FAQ


Computing at Cornell arrow Technology Support Professionals arrow Host Registration

Last updated: June 04, 2007
Please send comments to the dnsdb-admin team