> For the complete documentation index, see [llms.txt](https://docs.glesys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glesys.com/products/connectivity/domains-and-dns/how-tos/troubleshoot-and-test-dns-lookups.md).

# Troubleshoot and test DNS lookups

You can use tools such as nslookup to troubleshoot and test the DNS.

***

To test specific records in Glesys DNS, you can use the `nslookup` tool, which is available on Linux, macOS, and Microsoft Windows.

When starting the tool, you first set the DNS server to one of Glesys's DNS servers. This ensures that the data you query is fresh and not cached by another DNS server. You specify the server using the `server` keyword.

If you want to test whether the DNS works end-to-end (i.e., that DNS servers on the internet are resolving queries to Glesys's DNS servers for your domain), you set the server to, for example, Google's DNS.

You change the record type using `set type=TYPE`.

First, start the `nslookup` tool:

{% code title="Command" %}

```
nslookup
```

{% endcode %}

Now you can enter commands and look up hostnames at the `>` prompt.

<pre data-title="Example nslookup session. Commands are highlighted."><code><strong>> server ns1.namesystem.se
</strong>Default server: ns1.namesystem.se
Address: 195.238.76.18#53
Default server: ns1.namesystem.se
Address: 2a02:750:aaaa::1#53
<strong>> set type=A
</strong><strong>> example.com
</strong>Server:         ns1.namesystem.se
Address:        195.238.76.18#53

Name:   example.com
Address: 203.0.113.99
<strong>> exit
</strong></code></pre>

To look up the MX records for the domain *example.com*, use `set type=MX`. First, let's start `nslookup` again.

{% code title="Command" %}

```
nslookup
```

{% endcode %}

<pre data-title="Example nslookup session. Commands are highlighted."><code><strong>> server ns1.namesystem.se
</strong>Default server: ns1.namesystem.se
Address: 195.238.76.18#53
Default server: ns1.namesystem.se
Address: 2a02:750:aaaa::1#53
<strong>> set type=MX
</strong><strong>> example.com
</strong>Server:         ns1.namesystem.se
Address:        195.238.76.18#53

example.com  mail exchanger = 10 mx01.glesys.se.
example.com  mail exchanger = 10 mx02.glesys.se.
<strong>> exit
</strong></code></pre>

## Performing lookups from an external DNS

Here, we perform a lookup using Google's DNS. If everything is configured correctly, Google's DNS should query Glesys DNS for the information.

Start the `nslookup` tool again:

{% code title="Command" %}

```terminal
nslookup
```

{% endcode %}

<pre class="language-terminal" data-title="Example nslookup session. Commands are highlighted."><code class="lang-terminal"><strong>> server 8.8.8.8
</strong>Default server: 8.8.8.8
Address: 8.8.8.8#53
<strong>> set type=A
</strong><strong>> example.com
</strong>Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   example.com
Address: 203.0.113.99
</code></pre>

If it doesn’t work, try querying the NS records to check if they point to Glesys DNS servers.

<pre class="language-terminal" data-title="Example nslookup session. Commands are highlighted."><code class="lang-terminal"><strong>> server 8.8.8.8
</strong>Default server: 8.8.8.8
Address: 8.8.8.8#53
<strong>> set type=NS
</strong><strong>> example.com
</strong>Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
example.com  nameserver = ns3.namesystem.se.
example.com  nameserver = ns2.namesystem.se.
example.com  nameserver = ns1.namesystem.se.

Authoritative answers can be found from:
<strong>> exit
</strong></code></pre>
