SRSClient2 - SRS client using simple key-value pairs

This is a basic command-line based client for the SRS. It allows single transactions to be sent to the server in simple key-value pairs.

Options

Options may be either specified directly on the command line, or from a configuration file (“.rikrc” in the users home directory).

When the same option is specified using both methods, the command-line takes precedence. Additionally some options are synonymous with environment variables, but the command-line still takes precedence - and you shouldn’t set the environment variables as that method is deprecated and may be removed in a future release.

Short Long Details
-r –registrar_id (Required) Specifies the ID of the registrar to send requests as.
-f –file The file containing the request to be converted to XML, signed and sent to the SRS.
-d –debug Print the request and response to STDOUT.
  –url The URL of the SRS system which you would like to communicate with.
-t –timeout The time-out, in seconds, of the communications with the SRS system.
  –gpg_id Defines which GNUPG Id to use to sign the SRS request.
  –gpg_public Specifies the path to the public keyring containing the public key used for signing requests. This will normally be a pubring.gpg file, when using GnuPG.
  –gpg_passphrase Specifies the pass-phrase that will be used to unlock the PGP (or GPG) key used for signing requests.
  –gpg_passphrase_file Specifies the path to the file which contains pass-phrase that will be used to unlock the PGP (or GPG) key used for signing requests.
-h –help Prints these docs and exits

Note

To generate a GPG key please follow the instructions listed here: How do I generate a PGP key for use with SRS?

Status

While there are no plans to remove this client, its use is not recommended. No new transactions will be added, and changes to existing transactions will not be made.

The recommended command-line tools for connecting to the SRS are sendJSON, or sendXML.

Transactions

The following transaction types are supported. (All case insensitive).

  • Whois (alias: GetDomainDetails)
  • DomainDetailsQry
  • DomainCreate
  • DomainUpdate
  • GetMessages
  • UDAIValidQry
  • RegistrarCreate
  • RegistrarUpdate
  • RegistrarDetailsQry

Fields

Fields can either be specified directly on the command line, or read in from file, specified with the ‘-f’ flag. The format is fieldname: value. Fieldnames are case insensitive. Supported fields are:

Field Details Example
Transaction Required field - One of the transaction types listed above. Transaction: Whois
Domain_name The domain name (standard ASCII) Domain_name: internetnz.net.nz
Domain_name_unicode The domain name in unicode  
Domain_name_filter A list of domain names, separated by commas. If the transaction is DomainDetailsQry then the list of domain names CAN contain names using ? and * wild cards. If the transaction is DomainUpdate then the list of domain names CANNOT contain names using ? and * wild cards (see registrar kit documentation for information on this).  
Ns_name_n The FQDN (fully qualified domain name) of Name server n. The n should be a positive integer.  
Ns_ip_n The IPv4 address of Name server n. The n should be a positive integer.  
Ns_ip6_n The IPv6 address of Name server n. The n should be a positive integer.  
DS_key_tag_n The Key Tag of DNS DS record n for the domain. The n should be a positive integer. Up to 8 DS records are allowed.  
DS_algorithm_n The Algorithm of DNS DS record n for the domain. The n should be a positive integer.  
DS_digest_type_n The Digest Type of DNS DS record n for the domain. The n should be a positive integer.  
DS_digest_n The Digest of DNS DS record n for the domain. The n should be a positive integer.  
Locked_date_from Initial date for queries on domains locked after this date. All date fields need to be in the format: ‘dd/mm/yyyy,hh::mm::ss’ (Seconds are optional) For example: Locked_date_from: 29/05/2002,12:30 (indicates a date from 29/05/2002, 12:30pm)  
Locked_date_to End date for queries on domains locked before this date.  
Effective_date_from Initial date for queries on domains effective after this date.  
Effective_date_to End date for queries on domains effective befire this date.  
Billed_until_date_from Initial date for queries on domains billed until after this date.  
Billed_until_date_to End date for queries on domains billed until before this date.  
Registered_date_from Initial date for queries on domains registered after this date.  
Registered_date_to End date for queries on domains registered before this date.  
Cancelled_date_from Initial date for queries on domains cancelled after this date.  
Cancelled_date_to End date for queries on domains cancelled before this date.  
Trans_date_from Initial date for queries on transactions after this date.  
Trans_date_to End date for queries on transactions before this date.  
source_ip Specify to InternetNZ where this whois request came from  
full_result Defaults to True. A value of 0 in this field will return only the domain name and availability status for a whois query.  
Field_list Comma separated list of fields to return. Valid fields are: DomainName, Status, NameServers, RegistrantContact, RegisteredDate, AdminContact, TechnicalContact, Delegate, RegistrarId, RegistrarName, RegistrantRef, Term, LastActionId, BilledUntil, CancelledDate, LastChangeDate, LastChangedBy, AuditText  
Billing_term Integer indicating billing term in months.  
Delegate Defaults to 1. If 0, the domain will not be delegated to the DNS servers.  
Max_results Maximum number of results to display.  
Skip_results Number of results to be skipped. ‘0’ indicates no result is skipped.  
Audit_text Audit text supplied by registrar  
Action_id The action ID. Specifying %d will use a timestamp value.  
UDAI The Unique Domain Authentication Identifier.  
New_UDAI Requests a new UDAI to be returned.  
Renew_now Renew now flag. ‘0’ indicates false, ‘1’ indicates true.  
Cancel Cancel domain flag. ‘0’ indicates false, ‘1’ indicates true.  
Registrar_id Registrar ID.  
Status Domain Status. Valid Status values are: Active or PendingRelease  
URL The URL of a registrar’s home page.  
Name The name of the registrar  
Accref Registrar’s Accounting Reference  
Registrant_contact The contact identifier of the registrant.  
Registrant_customer_ref Registrar’s reference to the registrant.  
Registrant_name Name of the registrant contact.  
Registrant_phone Voice phone contact of the Registrant, in the format: +(country_code)-(area_code)-(local_number) eg. +64-4-4567890. The ‘+’ is optional and an extra ‘-‘ can optionally be placed in the local_number.  
Registrant_fax Fax number of the registrant, in the same format as Registrant_phone.  
Registrant_privacy Registrant privacy flag. ‘0’ indicates false, ‘1’ indicates true.  
Registrant_address1 Address line 1 of the registrant  
Registrant_address2 Address line 2 of the registrant  
Registrant_city City of the registrant  
Registrant_country Two letter country code of the registrant.  
Registrant_postalcode Postal code of the registrant.  
Registrant_email Email address of the registrant.  
Other Contact Fields All other contact fields follow the same format as registrant (with the exception of customer_ref and contact fields), but use one of the following as a prefix: Admin - (Administrative Contact), Tech - (Technical Contact), RegistrarSRS - (Registrar SRS Contact), RegistrarPub - (Registrar Public Contact), DefaultTech - (Registrar Default Technical Contact)  

Examples

Example 1 - Current details of a domain

rik@ubuntu1404:~/release-6-7-9$ cat ddq.txt
Transaction: DomainDetailsQry
Domain_Name_Filter: internetnz.net.nz
Field_list: Status,NameServers,RegistrantContact,RegisteredDate,AdminContact,TechnicalContact,LockedDate,Delegate,RegistrarId,RegistrarName
rik@ubuntu1404:~/release-6-7-9$ sh SRSClient2.sh -r 90 --gpg_id reg90-gpg-key@internetnz.net.nz -f ddq.txt
NZSRSResponse:
   RegistrarId => 90
   Response:
      Action => DomainDetailsQry
      FeId => 8
      FeSeq => 60580919
      FeTimeStamp:
         Day => 28
         Hour => 09
         Minute => 21
         Month => 05
         Second => 50
         TimeZoneOffset => +12:00
         Year => 2015
      OrigRegistrarId => 90
      RecipientRegistrarId => 90
      Rows => 0
   VerMajor => 6
   VerMinor => 7

Example 2 - Transfer and renew a domain

rik@ubuntu1404:~/release-6-7-9$ cat domaintransfer.txt
Transaction: DomainUpdate
Action_ID: transfer_renew_test_102610200401
Domain_Name_Filter: internetnz.net.nz
billing_term: 10
UDAI: KnD4ga8z
Renew_now: 1
audit_text: "transfer and renew domain for 10 months"
rik@ubuntu1404:~/release-6-7-9$ sh SRSClient2.sh -r 90 --gpg_id reg90-gpg-key@internetnz.net.nz -f domaintransfer.txt
Results:
   NZSRSResponse:
      RegistrarId => 90
      Response:
         Action => DomainUpdate
         Domain:
            AdminContact:
               Email => registry@internetnz.net.nz
               Fax:
                  AreaCode => 4
                  CountryCode => 64
                  LocalNumber => 9316979
               Name => Internet New Zealand Inc
               Phone:
                  AreaCode => 4
                  CountryCode => 64
                  LocalNumber => 9316970
               PostalAddress:
                  Address1 => Internet New Zealand Inc
                  Address2 => P O Box 24361
                  City => Wellington
                  CountryCode => NZ
                  PostalCode => 6021
                  Province => Wellington
            AuditDetails:
               ActionId => transfer_renew_test_102610200401
               AuditText => "transfer and renew domain for 10 months"
               AuditTime:
                  From:
                     Day => 28
                     Hour => 09
                     Minute => 34
                     Month => 05
                     Second => 33
                     TimeZoneOffset => +12:00
                     Year => 2015
               RegistrarId => 90
            BilledUntil:
               Day => 07
               Hour => 19
               Minute => 19
               Month => 04
               Second => 04
               TimeZoneOffset => +12:00
               Year => 2016
            Delegate => 1
            DomainName => internetnz.net.nz
            NameServers:
               Server List:
                  Server:
                     FQDN => ns1.dns.net.nz
                  Server:
                     FQDN => ns2.dns.net.nz
                  Server:
                     FQDN => ns3.dns.net.nz
                  Server:
                     FQDN => ns4.dns.net.nz
            RegisteredDate:
               Day => 07
               Hour => 19
               Minute => 19
               Month => 07
               Second => 04
               TimeZoneOffset => +12:00
               Year => 2002
            RegistrantContact:
               Email => registry@internetnz.net.nz
               Fax:
                  AreaCode => 4
                  CountryCode => 64
                  LocalNumber => 9316979
               Name => Internet New Zealand Inc
               Phone:
                  AreaCode => 4
                  CountryCode => 64
                  LocalNumber => 9316970
               PostalAddress:
                  Address1 => Internet New Zealand Inc
                  Address2 => P O Box 24361
                  City => Wellington
                  CountryCode => NZ
                  PostalCode => 6021
                  Province => Wellington
            RegistrarId => 90
            Status => Active
            TechnicalContact:
               Email => registry@internetnz.net.nz
               Fax:
                  AreaCode => 4
                  CountryCode => 64
                  LocalNumber => 9316979
               Name => Internet New Zealand Inc
               Phone:
                  AreaCode => 4
                  CountryCode => 64
                  LocalNumber => 9316970
               PostalAddress:
                  Address1 => Internet New Zealand Inc
                  Address2 => P O Box 24361
                  City => Wellington
                  CountryCode => NZ
                  PostalCode => 6021
                  Province => Wellington
            Term => 1
         FeId => 8
         FeSeq => 60581223
         FeTimeStamp:
            Day => 28
            Hour => 09
            Minute => 34
            Month => 05
            Second => 33
            TimeZoneOffset => +12:00
            Year => 2015
         OrigRegistrarId => 90
         RecipientRegistrarId => 90
         Rows => 1
         TransId => transfer_renew_test_102610200401
      VerMajor => 6
      VerMinor => 7