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.
Note: This guide uses the Postman API platform for example purposes. Each time you use the Telecom Liechtenstein REST API, you must authenticate in Postman.
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:
- Select the POST HTTP method.
- Set the request URL as https://smartsim.telecom.li/api/v1/dns
- Navigate to the Headers tab. Insert
Content-Type
andAuthorization
as Keys and add the respective Valuesapplication/json
andBearer TOKEN
. ReplaceTOKEN
with yourauth_token
and make sure there’s a non-breaking space betweenBearer
and the token value. - 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:
- Select the GET HTTP method.
- Set the request URL as https://smartsim.telecom.li/api/v1/dns
- Navigate to the Headers tab. Insert
Content-Type
andAuthorization
as Keys and add the respective Valuesapplication/json
andBearer TOKEN
. ReplaceTOKEN
with yourauth_token
and make sure there’s a non-breaking space betweenBearer
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:
- Click +New to create a new request.
- Select the PATCH HTTP method.
- Set the request URL as https://smartsim.telecom.li/api/v1/service_profile/{profile_id}, replacing
{profile_id}
with the service profile ID. - Navigate to the Headers tab. Insert
Content-Type
andAuthorization
as Keys and add the respective Valuesapplication/json
andBearer TOKEN
. ReplaceTOKEN
with yourauth_token
and make sure there’s a non-breaking space betweenBearer
and the token value. - 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:
- Select the DELETE HTTP method.
- 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. - Navigate to the Headers tab. Insert
Content-Type
andAuthorization
as Keys and add the respective Valuesapplication/json
andBearer TOKEN
. ReplaceTOKEN
with yourauth_token
and make sure there’s a non-breaking space betweenBearer
and the token value.
To complete the request, click Send. A 204 NO CONTENT
response status indicates that the DNS configuration was successfully deleted.
Warning: A DNS configuration can’t be deleted if it is in use by at least one Service Profile.