The Wayback Machine - https://web.archive.org/all/20060423205236/http://www.nic.uk:80/tag/auto/operations/bulk/

Nominet


Print this page  | Talk to Us

BULK operation


1 Introduction

This document describes the bulk automaton that allows tag-holders to list and modify many domain names without having to send in a single operation for each one. To do this send a message to the Automaton using the following instructions

  • send to the address auto-bulk@nic.uk
  • use the subject line TAG Bulk (replace TAG with your tag name in capitals)
  • specify the instructions using the command syntax below
  • make sure the e-mail is PGP-signed
A dry run facility is also available. This is described in section 5 - Dry run mode .

The bulk-automaton accepts PGP-signed emails which contain a request for a single bulk-modification or list. A bulk modification request contains a single update clause preceeded by an optional filter clause.  If there is no filter clause, all domain names on the signing tag will be updated.  A bulk list request will contain a single select clause preceeded by an optional filter clause. Again, if there is no filter clause, all domain names on the signing tag will be returned. For both bulk modification and lists, the purpose of the filter clause is to specify the set of domain names which will be modified or listed.

Examples of bulk modification and list requests are given in section 6 - Examples .


2.1 Update clause

An update clause lists the fields that will be updated and the new values for them. Valid update clauses are defined by the following:

update_clause:
update: update_field_list

update_field_list: field = STRING |
     nservers = [ nserver_list ] |
      nserver old_nserver = new_nserver |
      update_field_list


- STRING must be given in single quotes.
- field is a writable field listed in section 3.1 - Writable fields .
- nservers replaces all name-servers listed for a domain name by the list of nameservers in nserver_list . This is described more fully in section 3.5.3 - Replace single name-server.
- nserver replaces any occurrences of old_nserver with new_nserver . This is described more fully in section 3.5.4 - Replace all name-servers.

A select clause lists fields to be returned to the tag-holder. Valid select clauses are defined by the following:

select_clause:
select: select_field_list

select_field_list: select_field |
    select_field_list , select_field


- select_field is either a writable or read-only field as listed in section 3.1 - Writable fields and section 3.2 - Read-only fields; or nservers to return all nameservers; or a group field as defined in section 3.3 - Group fields .

All lists will be returned in a similar format to the standard automaton list requests - as a text email, one line per domain name with the fields split by the '|' character. All new line characters appearing in returned fields such as addresses will be replaced by a '^' character. 

A filter clause defines the domain names for a select or update clause to act upon. If there is no filter clause, all registered domain names on the signing pgp key are acted upon. Only domain names that are on the signing pgp-key are acted upon, it is not possible to modify or list domain names on a different pgp-key.

If a filter clause is used then it must preceed a select clause or update clause.
Valid filter clauses are defined by the following:

filter_clause:
filter: predicate

predicate: field =STRING |
  field 
like STRING |
  date_field <= DATE_STRING |
  date_field >= DATE_STRING |
  date_field < DATE_STRING |
  date_field > DATE_STRING |
  STRING in nservers |
  predicate or predicate |
  predicate and predicate |
  not predicate |
  ( predicate )

The usual precedence rules apply.

- field is a writable or read-only field as listed in section 3.1 - Writable fields and section 3.2 - Read-only fields .
- All filter clauses are case-insensitive.
like allows for wild-card filtering using the character '%'.
in nservers will check all nameservers held to find if the given string appears. This is described in section 3.5.1 - Name-server filtering .
- date_field is either created or changed.  Date fields and DATE_STRING are described more fully in section 3.4 - Date fields .

All filter clauses are case-insensitive.

The following fields may be updated with an update clause:
* reg-contact
* reg-trad-name
* reg-type
* reg-co-no
* reg-addr
* reg-city
* reg-county
* reg-postcode
* reg-country
* reg-fax
* reg-email
* reg-phone
* reg-opt-out
* notes
* admin-c
* a-phone
* a-fax
* a-email
* a-addr
* billing-c
* b-phone
* b-fax
* b-email
* b-addr
* first-bill
* recur-bill
* auto-bill
* next-bill
* ips-key

The following fields, along with those listed in section 3.1 - Writable fields , may be included in a filter or select clause:

* key
* registrant
* changed
* created
* expiry

The following fields can be included in a select clause to return a group of fields:

* reg-fields - returns registrant, reg-contact, reg-trad-name, reg-type, reg-co-no, reg-addr, reg-city, reg-county, reg-postcode,   reg-country, reg-fax, reg-email, reg-phone and reg-opt-out
* admin-fields - returns admin-c, a-addr, a-phone, a-fax and a-email
* billing-fields - returns billing-c, b-addr, b-phone, b-fax and b-email
* * - returns all fields.

The changed and created fields may be selected in a list request and also included in a filter request. The following comparisons are available for date filter clauses:

date-field < DATE_STRING
date-field > DATE_STRING
date-field >= DATE_STRING
date_field <= DATE_STRING

DATE_STRING must be of the format 'yyyymmdd'.
Name server can be specified by name (e.g. 'ns0.nserver.co.uk') or by IP address (e.g. '101.101.101.101').
Domain names on the signing pgp-key can be filtered by nameserver by using the string in nservers clause. For example
filter: 'ns0.nserver.co.uk' in nservers

All name servers which contain the string 'ns0.nserver.co.uk' will be included in the set to be acted upon. This will include any domain names with the given name server and a glue record. If a glue record is provided e.g:

filter: 'ns0.nserver.co.uk 101.101.101.101' in nservers
only domain names with the name server and glue record will be included in the set.
3.5.2 Selecting
By including nservers in a select clause, all name-servers will be returned for the requested domain names.
By including  nserver old_nserver = new_nserver in the update clause, all occurrences of old_nserver in the name-servers for the domain names defined by the filter clause will be replaced by new_nserver.
Any glue records provided in old_nserver are stripped out and the filter is based on the name only.

If any domain names defined by the filter clause need glue records then one must be provided in new_nserver, an error is returned if not. Glue records will only be saved for domain names that require them and will be stripped out for all other domain names affected.

old_nserver is case insensitive. Trailing dots are ignored - all domain names with the name-server with or without the trailing dot are updated.

new_nserver is not case insensitive. DNS will be updated to the exact contents of new_nserver - with or without capitals.
By including  nservers [ nserver_list ] in the update clause all name servers for the specified domain names will be removed and replaced by those in nserver_list. At least two name-servers must be provided.

If any of the domain names specified by the filter clause need glue records for the listed name-servers, the name server must include the glue record. Glue records are stripped out for domain names that don't require them.

Checks are made on the data provided in an update clause in the same way as for the main automaton.

If a line containing only dry-run: is contained in a modify request, the update will not be made. Two lists will be returned to the requestor, each containing the affected domain names and fields, showing the state of the domain names before and after the modification.

6.1 Example 1 - Replacing a name server
The following replaces ns0.nserver.co.uk with ns0.new-nserver.co.uk for all domain names on the signing pgp-key
update: nserver 'ns0.nserver.co.uk' = 'ns0.new-nserver.co.uk 120.120.120.120'
Glue records are written only for the domain name new-nserver.co.uk
6.2 Example 2 - Overwriting a name server
The following over-writes all the name-servers for all domain names on the signing pgp-key
update: nservers = [ 'ns0.nserver.co.uk 121.121.121.121',
'ns1.nserver.co.uk 101.101.101.101' ]
Glue records are stored for the domain name nserver.co.uk only.
6.3 Example 3 - Name Server filtered list
The following example will update the name servers of domain names where the name server “ns1.nominet.org.uk” is present.
filter: 'ns1.nominet.org.uk' in nservers 
update: nservers = [ 'ns0.nserver.co.uk 121.121.121.121','ns1.nserver.co.uk 101.101.101.101' ]
6.4 Example 4 - Update fields in filtered list
The following updates the reg- fields for all domain names where the registrant is 'Mr Reg. I. Strant'
filter: registrant = 'mr reg. I. strant'
update: reg-contact = 'Reginald Strant',
reg-type = 'IND',
reg-opt-out = 'y',
reg-addr = '10, The Avenue, Streatham',
reg-city = 'London',
reg-county = 'NULL',
reg-postcode = 'ST14 5TH',
reg-country = 'GB'
Setting reg-county to 'NULL' strips out the reg-county in line with the main automaton.
6.5 Example 5 - Date filtered list 1
To obtain billing fields for domain names registered in Jan 2002
filter: created >= '20020101' and created < '20020201'
select: billing-fields
6.6 Example 6 - Date filtered list 2
To obtain reg-fields for pre-Nominet domain names
filter: created = ''
select: reg-fields
6.7 Example 7 - Registrant filtered list 1
To obtain a list containing only the domain names where “Reginald Strant” is the legal registrant.
filter: registrant = 'Reginald Strant'
select: key
6.8 Example 8 - Registrant filtered list 2
To obtain a list of domain names and all the admin contact information where the legal registrant first name is 'Reginald'.
filter: registrant like 'Reginald %'
select: admin-fields
6.9 Example 9 - Registrant and reg-postcode filtered list

The following example will return the domain names where the registrant is “Reginald Strant” and the reg-postcode field is 'OX4 6LB'.

filter: registrant = 'Reginald Strant' and reg-postcode = 'OX4 6LB'
select: reg-addr, reg-city, reg-county, reg-postcode
6.10 Example 10 – Filtered out domain names

To update the auto-bill field to the value of '1' for all the domain names on your tag apart from 'domainname.co.uk and domainname2.co.uk' Note that that this example containts the "dry-run:" mode, which means that the update will not be made. See more information on the dry run here.

dry-run:
filter: not (key = 'automaton-example.co.uk' or key = 'automaton-example.org.uk')
update: auto-bill = '1'
 
 
 

© Nominet UK 1996-2006