1. Home
  2. Product Features
  3. Authoritative DNS
  4. Getting Started w/NOC API – Authoritative DNS
  1. Home
  2. Getting Started
  3. Getting Started w/NOC API – Authoritative DNS

Getting Started w/NOC API – Authoritative DNS

The NOC API exposes the entire Cloudflare infrastructure via a standardized programmatic interface. Using the NOC API you can update and manipulate most of the dashboard settings.

The NOC API is a RESTful API based on HTTPS requests and JSON responses. If you are registered with NOC, you can obtain your API key from the DNS API Access page.

Endpoints

The API is accessed by making HTTPS requests to a specific version endpoint URL, in which the GET methods dictates how to interact with the information available. Every endpoint is accessed only via the SSL-enabled HTTPS (port 443) protocol.

The stable base URL for the endpoint is:

https://my.noc.org/api

All API requests must included in the API call. The API key is provided via the DNS API Access page.

Example of how it will work:https://my.noc.org/api?apikey=[api_key]

OperationDescription
Domain/addAdds a new domain.
Domain/removeDeletes a domain name.
Domains/listList all domains in your account.
Record/addAdds a new DNS record to a domain.
Record/deleteDeletes a DNS record from a domain.
Records/listList all DNS records for a domain.
Sub_domain/set/routingConfigure routing type

Domain/Add

Adds a new domain to your NOC DNS Account.

NameDescription
Actiondomain/add
Required valuedomain_name=(valid_domain_name)
Results:{“status” = “success”};
In case of error:{“status”:”failed”, “reason”:”reason why”}

Example URL

https://my.noc.org/api?apikey=[API-KEY]&action=domain/add&domain_name=<DOMAINNAME>

Domain/Remove

Deletes a domain from your account. You need to remove all DNS records before this action is authorized.

NameDescription
Actiondomain/remove
Required valuedomain_name=(valid_domain_name)
Results:{“status” = “success”};
In case of error:{“status”:”failed”, “reason”:”reason why”}

Example URL

https://my.noc.org/api?apikey=[API-KEY]&action=domain/remove&domain_name=<DOMAINNAME>

Domain/list

List all domains in your account.

NameDescription
Actiondomain/list
Results:{“status”:”success”,”domains”:[“mytestdomain.com”,”globo.com”]}
In case of error:{“status”:”failed”, “reason”:”reason why”}

Example URL

https://my.noc.org/api?apikey=[API-KEY]&action=domains/list

Record/Add

Adds a new DNS record.

NameDescription
Actionrecord/add
Required valuedomain_name=(valid_domain), sub_domain=(valid_subdomain), record_type=(DNS Type: A,AAAA. MX, etc), address=(valid IP address)
Optional Valuettl=(DNS TTL), default to 3600 seconds when not provided.
Results:{“status” = “success”};
In case of error:{“status”:”failed”, “reason”:”reason why”}

Example URL:

https://my.noc.org/api?apikey=[API-KEY]&action=record/add&domain_name=domain.com&sub_domain=www&ttl=120&record_type=A&address=192.168.1.1>

Record/Delete

Deletes a DNS record.

NameDescription
Actionrecord/delete
Required valuerecordid=(Domain record), domain_name=(valid_domain), sub_domain=(valid_subdomain)
Results:{“status” = “success”};
In case of error:{“status”:”failed”, “reason”:”reason why”}

Example URL:

https://my.noc.org/api?apikey=[API-KEY]&action=record/delete&domain_name=domain.com&recordid=X&sub_domain=SUBDOMAIN

Record/list

List all DNS records for a specific domain name.

NameDescription
Actionrecord/list
Required valuedomain_name=(valid_domain_name) or “all”
In case of error:{“status”:”failed”, “reason”:”reason why”}

Example URL:

https://my.noc.org/api?apikey=[API-KEY]&action=records/list&domain_name=domain.com
Sub_domain/set/routing

Sets the routing type for a sub domain with multiple records. Routing types available via the API: disabled (all records always on), distance_routing (we pick the best and closest IP address based on our tests) and simple_failover (we remove records that fail our monitoring).

NameDescription
Actionsub_domain/set/routing
Required Valuedomain_name=(valid_domain), sub_domain=(valid_subdomain), routing_type=(disabled|distance_routing|simple_failover)
Optional Valuerouting_monitoring=(ping|http|https)
Results{“status” = “success”};
In case of error{“status”:”failed”, “reason”:”reason why”}

Example URL:

https://my.noc.org/api?apikey=[API-KEY]&action=sub_domain/set/routing&domain_name=domain.com&sub_domain=www&routing_type=distance_routing&routing_monitoring=ping
Updated on July 9, 2024
Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Email: support@noc.org

Leave a Comment