Configure DNS Settings

You can specify a DNS configuration using the SmartSIM API. This allows you to specify primary and secondary nameservers for the DNS resolution of device networking.

DNS changes are instantly applied to any new PDP context. Devices that are already connected with established PDPs continue to use the previous nameserver configuration until the next time they reconnect.

Create a new DNS configuration

You can create a new custom DNS using the Create DNS config API call.

To create a new request in Postman, click +New in the upper left corner. Name the request Create DNS Config and add it to a new collection called DNS.

Then follow these steps to set up your request:

  1. Select the POST HTTP method.
  2. Set the request URL as https://smartsim.telecom.li/api/v1/dns
  3. Navigate to the Headers tab. Insert Content-Type and Authorization as Keys and add the respective Values application/json and Bearer TOKEN. Replace TOKEN with your auth_token and make sure there’s a non-breaking space between Bearer and the token value.
  4. Go to the Body tab and select raw. Make sure the format is set to JSON. Then, to configure OpenDNS for example, use the following:
{
    "primary": "208.67.222.222",
    "secondary": "208.67.220.220",
    "ip_address_version": 4
}

To complete the request, click Send. A 201 CREATED response status indicates that the DNS configuration was successfully created.

Find the DNS configuration ID

Once you’ve created a new DNS configuration, you can find it using the List DNS Configs API call.

Click +New in the upper left corner to create a new request in Postman. Name the request List DNS Configs and add it to your DNS collection.

Then follow these steps to set up your request:

  1. Select the GET HTTP method.
  2. Set the request URL as https://smartsim.telecom.li/api/v1/dns
  3. Navigate to the Headers tab. Insert Content-Type and Authorization as Keys and add the respective Values application/json and Bearer TOKEN. Replace TOKEN with your auth_token and make sure there’s a non-breaking space between Bearer and the token value.

To complete the request, click Send. In the response body, you can find the ID of your new DNS configuration.

Update or create a new Service Profile with the DNS configuration ID

You can use the DNS configuration ID to update an existing service profile with the Update Service Profile API call or create a one with the Create Service Profile API call.

Here is an example showing how to update your Service Profile with your custom DNS in Postman:

  1. Click +New to create a new request.
  2. Select the PATCH HTTP method.
  3. Set the request URL as https://smartsim.telecom.li/api/v1/service_profile/{profile_id}, replacing {profile_id} with the service profile ID.
  4. Navigate to the Headers tab. Insert Content-Type and Authorization as Keys and add the respective Values application/json and Bearer TOKEN. Replace TOKEN with your auth_token and make sure there’s a non-breaking space between Bearer and the token value.
  5. Go to the Body tab and select raw. Make sure the format is set to JSON. Then, provide a DNS object, replacing 1234 with your DNS configuration ID:
{
    "dns": {
        "id": 1234
    }
}

To complete the request, click Send. A 201 CREATED response status indicates that the service profile was successfully updated.

Delete a DNS cofiguration

You can create a new custom DNS using the Delete DNS config API call.

Click +New in the upper left corner to create a new request in Postman. Name the request Delete DNS Config and add it to your DNS collection.

Then follow these steps to set up your request:

  1. Select the DELETE HTTP method.
  2. Set the request URL as https://smartsim.telecom.li/api/v1/dns/{dns_id}, replacing {dns_id} with the ID of the DNS configuration you want to delete.
  3. Navigate to the Headers tab. Insert Content-Type and Authorization as Keys and add the respective Values application/json and Bearer TOKEN. Replace TOKEN with your auth_token and make sure there’s a non-breaking space between Bearer and the token value.

To complete the request, click Send. A 204 NO CONTENT response status indicates that the DNS configuration was successfully deleted.