Note
The NS1 CLI package is applicable only to NS1 Managed DNS users. The NS1 CLI package is not under active development and is not feature complete. We suggest using one of our other packages for production integrations.
NS1's command-line interface (ns1cli) is a lightweight shell application that can be installed easily from the pip package manager—enabling access to the NS1 platform.
From your command line, execute a pip install for the ns1cli package:
$ pip install ns1cli
Once complete, the requisite components are loaded into your environment and the utility is ready to use.
Using your unique API key generated via the NS1 portal (http://my.nsone.net), enter the following command to store your API key in the local configuration:
$ ns1 -k [API KEY]
Once complete, the API key is stored in the local configuration as your default key. The key will remain in the system until superseded by using the same commands or with the 'config key' command.
The application is now running in your terminal window.
ns1 CLI version x.y Type 'help' for help Current Key: default Endpoint: https://api.nsone.net/v1/ ns1>
|
Create, retrieve, update, and delete records in a zone |
|
View and manipulate configuration settings |
|
Get help on a command |
|
Create, retrieve, update, and delete zone SOA data |
|
Retrieve queries per second |
The following functions can be invoked with the record
calls:
record info ZONE DOMAIN TYPE record create [options] [--] ZONE DOMAIN TYPE ([--priority=<p>] ANSWER)... record delete [-f] ZONE DOMAIN TYPE record link ZONE SOURCE_DOMAIN DOMAIN TYPE record set ZONE DOMAIN TYPE options record meta set ZONE DOMAIN TYPE KEY VALUE record meta remove ZONE DOMAIN TYPE KEY VALUE record answer add ZONE DOMAIN TYPE [--priority=<p>] ANSWER record answer remove ZONE DOMAIN TYPE ANSWER record answer meta set ZONE DOMAIN TYPE ANSWER KEY VALUE record answer meta remove ZONE DOMAIN TYPE ANSWER KEY record answers ZONE DOMAIN TYPE [options] (ANSWER ...)
The following functions can be invoked with the zone
call:
zone list zone info ZONE zone create ZONE [-f] [options] zone delete [-f] ZONE zone set ZONE [-f] [options]
NS1 is constantly making improvements and enhancements, and your feedback has a direct impact on product development. Please submit your feedback directory to us or submit your own pull requests. Pull requests can be made from a fork of the ns1cli repository into a branch other than master. You can access the source on NS1's GitHub.