> For the complete documentation index, see [llms.txt](https://learn.netmaker.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.netmaker.io/api-spec/dns.md).

# DNS

## GET /api/dns

> Get all DNS entries

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/dns":{"get":{"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/models.DNSEntry"},"type":"array"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Get all DNS entries","tags":["DNS"]}}},"components":{"schemas":{"models.DNSEntry":{"properties":{"address":{"type":"string"},"address6":{"type":"string"},"name":{"maxLength":192,"minLength":1,"type":"string"},"network":{"type":"string"}},"required":["name"],"type":"object"},"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```

## POST /api/dns/{network}

> Create a new DNS entry

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/dns/{network}":{"post":{"parameters":[{"schema":{"type":"string"},"description":"Network identifier","in":"path","name":"network","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.DNSEntry"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Create a new DNS entry","tags":["DNS"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.DNSEntry"}}},"description":"DNS entry details","required":true}}}},"components":{"schemas":{"models.DNSEntry":{"properties":{"address":{"type":"string"},"address6":{"type":"string"},"name":{"maxLength":192,"minLength":1,"type":"string"},"network":{"type":"string"}},"required":["name"],"type":"object"},"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```

## DELETE /api/dns/{network}/{domain}

> Delete a DNS entry

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/dns/{network}/{domain}":{"delete":{"parameters":[{"schema":{"type":"string"},"description":"Network identifier","in":"path","name":"network","required":true},{"schema":{"type":"string"},"description":"Domain Name","in":"path","name":"domain","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Delete a DNS entry","tags":["DNS"]}}},"components":{"schemas":{"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```

## GET /api/dns/adm/{network}

> Get all DNS entries associated with the network

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/dns/adm/{network}":{"get":{"parameters":[{"schema":{"type":"string"},"description":"Network identifier","in":"path","name":"network","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/models.DNSEntry"},"type":"array"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Get all DNS entries associated with the network","tags":["DNS"]}}},"components":{"schemas":{"models.DNSEntry":{"properties":{"address":{"type":"string"},"address6":{"type":"string"},"name":{"maxLength":192,"minLength":1,"type":"string"},"network":{"type":"string"}},"required":["name"],"type":"object"},"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```

## GET /api/dns/adm/{network}/custom

> Gets custom DNS entries associated with a network

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/dns/adm/{network}/custom":{"get":{"parameters":[{"schema":{"type":"string"},"description":"Network identifier","in":"path","name":"network","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/models.DNSEntry"},"type":"array"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Gets custom DNS entries associated with a network","tags":["DNS"]}}},"components":{"schemas":{"models.DNSEntry":{"properties":{"address":{"type":"string"},"address6":{"type":"string"},"name":{"maxLength":192,"minLength":1,"type":"string"},"network":{"type":"string"}},"required":["name"],"type":"object"},"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```

## GET /api/dns/adm/{network}/nodes

> Gets node DNS entries associated with a network

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/dns/adm/{network}/nodes":{"get":{"parameters":[{"schema":{"type":"string"},"description":"Network identifier","in":"path","name":"network","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/models.DNSEntry"},"type":"array"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Gets node DNS entries associated with a network","tags":["DNS"]}}},"components":{"schemas":{"models.DNSEntry":{"properties":{"address":{"type":"string"},"address6":{"type":"string"},"name":{"maxLength":192,"minLength":1,"type":"string"},"network":{"type":"string"}},"required":["name"],"type":"object"},"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```

## POST /api/dns/adm/{network}/sync

> Sync DNS entries for a given network

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/dns/adm/{network}/sync":{"post":{"parameters":[{"schema":{"type":"string"},"description":"Network identifier","in":"path","name":"network","required":true}],"responses":{"200":{"description":"DNS Sync completed successfully","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Sync DNS entries for a given network","tags":["DNS"]}}},"components":{"schemas":{"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```

## POST /api/dns/adm/pushdns

> Push DNS entries to nameserver

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/dns/adm/pushdns":{"post":{"responses":{"200":{"description":"DNS Pushed to CoreDNS","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Push DNS entries to nameserver","tags":["DNS"]}}},"components":{"schemas":{"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```

## GET /api/v1/nameserver

> List Nameservers

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/v1/nameserver":{"get":{"parameters":[{"schema":{"type":"string"},"description":"Network identifier","in":"query","name":"network","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/schema.Nameserver"},"type":"array"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"List Nameservers","tags":["DNS"]}}},"components":{"schemas":{"schema.Nameserver":{"properties":{"created_at":{"type":"string"},"created_by":{"type":"string"},"default":{"type":"boolean"},"description":{"type":"string"},"domains":{"items":{"$ref":"#/components/schemas/schema.NameserverDomain"},"type":"array"},"fallback":{"type":"boolean"},"id":{"type":"string"},"match_all":{"type":"boolean"},"match_domains":{"description":"TODO: deprecate","items":{"type":"string"},"type":"array"},"name":{"type":"string"},"network_id":{"type":"string"},"nodes":{"$ref":"#/components/schemas/datatypes.JSONMap"},"servers":{"items":{"type":"string"},"type":"array"},"status":{"type":"boolean"},"tags":{"$ref":"#/components/schemas/datatypes.JSONMap"},"updated_at":{"type":"string"}},"type":"object"},"schema.NameserverDomain":{"properties":{"domain":{"type":"string"},"is_search_domain":{"type":"boolean"}},"type":"object"},"datatypes.JSONMap":{"additionalProperties":true,"type":"object"},"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```

## POST /api/v1/nameserver

> Create Nameserver

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/v1/nameserver":{"post":{"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/schema.Nameserver"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Create Nameserver","tags":["DNS"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.NameserverReq"}}},"description":"Nameserver request body","required":true}}}},"components":{"schemas":{"schema.Nameserver":{"properties":{"created_at":{"type":"string"},"created_by":{"type":"string"},"default":{"type":"boolean"},"description":{"type":"string"},"domains":{"items":{"$ref":"#/components/schemas/schema.NameserverDomain"},"type":"array"},"fallback":{"type":"boolean"},"id":{"type":"string"},"match_all":{"type":"boolean"},"match_domains":{"description":"TODO: deprecate","items":{"type":"string"},"type":"array"},"name":{"type":"string"},"network_id":{"type":"string"},"nodes":{"$ref":"#/components/schemas/datatypes.JSONMap"},"servers":{"items":{"type":"string"},"type":"array"},"status":{"type":"boolean"},"tags":{"$ref":"#/components/schemas/datatypes.JSONMap"},"updated_at":{"type":"string"}},"type":"object"},"schema.NameserverDomain":{"properties":{"domain":{"type":"string"},"is_search_domain":{"type":"boolean"}},"type":"object"},"datatypes.JSONMap":{"additionalProperties":true,"type":"object"},"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"},"models.NameserverReq":{"properties":{"description":{"type":"string"},"match_domain":{"type":"string"},"name":{"type":"string"},"network":{"type":"string"},"servers":{"items":{"type":"string"},"type":"array"},"status":{"type":"boolean"},"tags":{"items":{"type":"string"},"type":"array"}},"type":"object"}}}}
```

## PUT /api/v1/nameserver

> Update Nameserver

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/v1/nameserver":{"put":{"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/schema.Nameserver"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Update Nameserver","tags":["DNS"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.NameserverReq"}}},"description":"Nameserver request body","required":true}}}},"components":{"schemas":{"schema.Nameserver":{"properties":{"created_at":{"type":"string"},"created_by":{"type":"string"},"default":{"type":"boolean"},"description":{"type":"string"},"domains":{"items":{"$ref":"#/components/schemas/schema.NameserverDomain"},"type":"array"},"fallback":{"type":"boolean"},"id":{"type":"string"},"match_all":{"type":"boolean"},"match_domains":{"description":"TODO: deprecate","items":{"type":"string"},"type":"array"},"name":{"type":"string"},"network_id":{"type":"string"},"nodes":{"$ref":"#/components/schemas/datatypes.JSONMap"},"servers":{"items":{"type":"string"},"type":"array"},"status":{"type":"boolean"},"tags":{"$ref":"#/components/schemas/datatypes.JSONMap"},"updated_at":{"type":"string"}},"type":"object"},"schema.NameserverDomain":{"properties":{"domain":{"type":"string"},"is_search_domain":{"type":"boolean"}},"type":"object"},"datatypes.JSONMap":{"additionalProperties":true,"type":"object"},"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"},"models.NameserverReq":{"properties":{"description":{"type":"string"},"match_domain":{"type":"string"},"name":{"type":"string"},"network":{"type":"string"},"servers":{"items":{"type":"string"},"type":"array"},"status":{"type":"boolean"},"tags":{"items":{"type":"string"},"type":"array"}},"type":"object"}}}}
```

## DELETE /api/v1/nameserver

> Delete Nameserver Resource

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/v1/nameserver":{"delete":{"parameters":[{"schema":{"type":"string"},"description":"Nameserver ID","in":"query","name":"id","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"Delete Nameserver Resource","tags":["DNS"]}}},"components":{"schemas":{"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```

## GET /api/v1/nameserver/global

> List Global Nameservers

```json
{"openapi":"3.1.1","info":{"title":"NetMaker","version":"1.4.0"},"tags":[],"servers":[{"url":"http://api.demo.netmaker.io"}],"security":[{"oauth":[]}],"paths":{"/api/v1/nameserver/global":{"get":{"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"additionalProperties":{"$ref":"#/components/schemas/schema.Nameserver"},"type":"object"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"summary":"List Global Nameservers","tags":["DNS"]}}},"components":{"schemas":{"schema.Nameserver":{"properties":{"created_at":{"type":"string"},"created_by":{"type":"string"},"default":{"type":"boolean"},"description":{"type":"string"},"domains":{"items":{"$ref":"#/components/schemas/schema.NameserverDomain"},"type":"array"},"fallback":{"type":"boolean"},"id":{"type":"string"},"match_all":{"type":"boolean"},"match_domains":{"description":"TODO: deprecate","items":{"type":"string"},"type":"array"},"name":{"type":"string"},"network_id":{"type":"string"},"nodes":{"$ref":"#/components/schemas/datatypes.JSONMap"},"servers":{"items":{"type":"string"},"type":"array"},"status":{"type":"boolean"},"tags":{"$ref":"#/components/schemas/datatypes.JSONMap"},"updated_at":{"type":"string"}},"type":"object"},"schema.NameserverDomain":{"properties":{"domain":{"type":"string"},"is_search_domain":{"type":"boolean"}},"type":"object"},"datatypes.JSONMap":{"additionalProperties":true,"type":"object"},"models.ErrorResponse":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"response":{}},"type":"object"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://learn.netmaker.io/api-spec/dns.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
