> This page is for Portal.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.emnify.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emnify.com/_mcp/server.

> How to configure a custom DNS and other DNS settings in the emnify Portal

You have the option to configure your own DNS settings, no matter if it's a public or a private server.
DNS settings can be changed in [**Device Policies**](https://portal.emnify.com/device-policies) on the emnify Portal.
By default, emnify uses the Google DNS 8.8.8.8 and 8.8.4.4.

> **Warning**
>
> Changes save automatically, but your devices may take up to 24 hours to use the new settings due to caching.
> Be sure to [reset the connectivity](/portal/connected-devices#reset-connectivity) of devices on this service policy so that the change takes effect sooner.

> **Info**
>
> Utilizing a private DNS server that isn't accessible via the public internet requires establishing a private network with the device or a network where the private DNS server is situated.
> This can be accomplished using Cloud Connect through Amazon Transit Gateway or IPsec.
>
> See [DNS Filtering with emnify Cloud Connect and AWS Route53](https://www.emnify.com/developer-blog/dns-filtering) on the emnify Developer Blog for step-by-step instructions.

## Add a custom DNS

In [**Service Policies**](https://portal.emnify.com/device-policies#service-policies), choose the policy you want to update and expand the policy details.

In **Data**, find the **Custom DNS Server** section.
By default, the badge next to the section title reads **Default DNS**.

Click **Edit** to open the configuration modal.

Enter a valid IP address in the **Primary NS** and **Secondary NS** fields.
Click **Confirm** to save your changes.

The **Custom DNS Server** section of the policy details should display the **Configured DNS** badge and the updated IP address values.

## Edit a custom DNS

In [**Service Policies**](https://portal.emnify.com/device-policies#service-policies), choose the policy you want to update and expand the policy details.

In **Data**, find the **Custom DNS Server** section.
The badge next to the section title should read **Configured DNS**.

Click **Edit** to open the configuration modal.

Edit the **Primary NS** or **Secondary NS** field, then click **Confirm** to save your changes.

The **Custom DNS Server** section of the policy details should display the updated IP address values.

## Delete a custom DNS

In [**Service Policies**](https://portal.emnify.com/device-policies#service-policies), choose the policy you want to update and expand the policy details.

In **Data**, find the **Custom DNS Server** section.
The badge next to the section title should read **Configured DNS**.

Click **Edit** to open the configuration modal.

Click **Delete**, then select **Confirm** to save your changes.

The **Custom DNS Server** section of the policy details should display the **Default DNS** badge and the updated IP address values.

## Configure DNS settings with the emnify REST API

You can also add, list, or delete DNS configurations using the emnify REST API.
For step-by-step instructions, see [Configure DNS Settings](/developers/connectivity/configure-dns) in the Developers documentation.