Skip to content

Public API

Below are all public APIs that do not require any kind of authentication.

DNS Check

The .it Registry offers the option to check a domain's DNS configuration via the DNS Check web service. This web service uses the DNS validation API, as described below.

DNS validation

1.0 |

POST https://api.nic.it/v1/dns-check/validate

DNS validation can be performed using either an exchange of data in XML or JSON format.

Due to OpenAPI specification limitations, the OpenAPI documentation for dnsCheck should only be used for DNS validation in JSON format. For XML format, see the specific XML Schema. Since the validation response is typically very long, the following examples will never report the result; for more information, refer to the links above.

Example of validation with request and response in JSON or XML format:

curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '
    {
        "domain": "nic.it"
    }'\
    https://api.nic.it/v1/dns-check/validate
curl -X POST \
    -H "Content-Type: application/xml" \
    -H "Accept: application/xml" \
    -d '
    <request>
        <domain>nic.it</domain>
    </request>'\
    https://api.nic.it/v1/dns-check/validate

The above example refers to a domain that has already been registered and delegated; therefore, the request doesn't specify the domains's authoritative nameservers, which are then identified through standard DNS resolution mechanisms.

Example of validation also specifying the domain's authoritative nameservers and, if applicable, IP addresses (required for subordinate nameservers):

curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '
    {
        "domain": "my-domain-test.it", 
        "nameservers": [ 
            { "name": "ns1.my-domain-test.it",
              "address": [ 
                { 
                    "value": "192.12.192.5", 
                    "type": "IPv4"
                }
              ]
            }, 
            { "name": "ns.other-domain.it"} 
        ] 
    }'\
    https://api.nic.it/v1/dns-check/validate
curl -X POST \
    -H "Content-Type: application/xml" \
    -H "Accept: application/xml" \
    -d '
    <request>
        <domain>my-domain-test.it</domain>
        <nameservers>
            <nameserver name="ns1.my-domain-test.it">
                <address type="IPv4">192.12.192.5</address>
            </nameserver>
            <nameserver name="ns.other-domain.it"></nameserver>
        </nameservers>
    </request>'\
    https://api.nic.it/v1/dns-check/validate

If not specified, DNSSEC validation is disabled and can be enabled by adding the parameter dnsSecDisabled with a value of false to the request.
You can also specify the DS Records to validate, if necessary, as in the following example:

curl -X POST https://api.nic.it/v1/dns-check/validate \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '
    {
        "domain": "my-domain-test.it",
        "dnsSecDisabled": false,
        "dsRecords": [ 
            { "keytag": 12345,
              "algorithm": 10,
              "digestType": 2,
              "digest": "1D4A1152C4880D31583393E1C0604364708F7B3A481C4F16D3CD279EDC0E2861"
            } 
        ] 
    }'
curl -X POST https://api.nic.it/v1/dns-check/validate \
    -H "Content-Type: application/xml" \
    -H "Accept: application/xml" \
    -d '
    <request>
        <domain>my-domain-test.it</domain>
        <dsRecords>
            <dsRecord>
                <keytag>12345</keytag>
                <algorithm>10</algorithm>
                <digestType>2</digestType>
                <digest>1D4A1152C4880D31583393E1C0604364708F7B3A481C4F16D3CD279EDC0E2861</digest>
            </dsRecord>
        </dsRecords>
        <dnsSecDisabled>false</dnsSecDisabled>
    </request>'

Info

Only in DNS validation in JSON format, it is possible to add in the URL the format parameter, which can assume the following values:

  • minimal: returns only the outcome of the validation
  • terse: returns the validation outcome and the tests result
  • verbose: default value, return the validation outcome, the tests result and the details of all queries executed
Esempio con parametro format
curl -X POST https://api.nic.it/v1/dns-check/validate?format=minimal \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '
    {
        "domain": "nic.it"
    }'
Risposta in formato JSON
{
    "domain": "nic.it.",
    "status": "SUCCEEDED",
    "validationId": "15f5c881-79c6-4e36-afa1-216e3dcded25",
    "validationDate": 1712222370464,
    "version": "2.1"
}

DNS validator configuration

1.0 |

GET https://api.nic.it/v1/dns-check/config

Returns the DNS validator configuration, mainly used by the DNS Check web service.

Example:

curl  https://api.nic.it/v1/dns-check/config
{
  "itOnly": false,
  "maxDSRecords": 1,
  "nameserversMin": 2,
  "nameserversMax": 6,
  "dnsSecEnabled": true,
  "ipv6Enabled": true
}

Statistics

1.0 |

The statistics API is used by the Registry Statistics web service. For more information, see the OpenAPI documentation.

Geographical Data

Italian provinces list

1.0 |

GET https://api.nic.it/v1/province

Returns the list of all Italian provinces, example:

curl https://api.nic.it/v1/province \
    -H "Accept: application/json"
[
  {
    "code": "AG",
    "name": "Agrigento"
  },
  {
    "code": "AL",
    "name": "Alessandria"
  },
  {
    "code": "AN",
    "name": "Ancona"
  }
  // ....
]
http https://api.nic.it/v1/province
[
  {
    "code": "AG",
    "name": "Agrigento"
  },
  {
    "code": "AL",
    "name": "Alessandria"
  },
  {
    "code": "AN",
    "name": "Ancona"
  }
  // ....
]

Countries list

1.0 |

GET https://api.nic.it/v1/countries

Returns the list of countries and their (ISO3166) codes that can be used in contacts associated to domains registered under the ccTLD .it. Example:

curl https://api.nic.it/v1/countries
 -H "Accept: application/json"
[
  {
    "name": "Afghanistan",
    "enabled": false,
    "code": "af"
  },
  {
    "name": "Aland Islands",
    "enabled": false,
    "code": "ax"
  },
  {
    "name": "Albania",
    "enabled": false,
    "code": "al"
  }
  // ....
]
http https://api.nic.it/v1/countries
[
  {
    "name": "Afghanistan",
    "enabled": false,
    "code": "af"
  },
  {
    "name": "Aland Islands",
    "enabled": false,
    "code": "ax"
  },
  {
    "name": "Albania",
    "enabled": false,
    "code": "al"
  }
  // ....
]

The enabled field indicates whether the country code can be used as a value in the nationality field of the .it domain registrant.

You can obtain the list of only the enabled countries, as in the following example:

curl "https://api.nic.it/v1/countries?enabledOnly=true" \
    -H "Accept: application/json"
http https://api.nic.it/v1/countries enabledOnly==true