---
id: list-all-nameserver-groups
title: "List all Nameserver Groups"
description: "Returns a list of all Nameserver Groups"
sidebar_label: "List all Nameserver Groups"
hide_title: true
hide_table_of_contents: true
api: {"description":"Returns a list of all Nameserver Groups","tags":["DNS"],"security":[{"BearerAuth":[]},{"TokenAuth":[]}],"responses":{"200":{"description":"A JSON Array of Nameserver Groups","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"type":"object","properties":{"id":{"description":"Nameserver group ID","type":"string"}},"required":["id"]},{"type":"object","properties":{"name":{"description":"Nameserver group name","type":"string","maxLength":40,"minLength":1},"description":{"description":"Nameserver group  description","type":"string"},"nameservers":{"description":"Nameserver group","minLength":1,"maxLength":2,"type":"array","items":{"type":"object","properties":{"ip":{"description":"Nameserver IP","type":"string"},"ns_type":{"description":"Nameserver Type","type":"string","enum":["udp"]},"port":{"description":"Nameserver Port","type":"integer"}},"required":["ip","ns_type","port"],"title":"Nameserver"}},"enabled":{"description":"Nameserver group status","type":"boolean"},"groups":{"description":"Nameserver group tag groups","type":"array","items":{"type":"string"}},"primary":{"description":"Nameserver group primary status","type":"boolean"},"domains":{"description":"Nameserver group domain list","type":"array","items":{"type":"string","minLength":1,"maxLength":255}}},"required":["name","description","nameservers","enabled","groups","primary","domains"],"title":"NameserverGroupRequest"}],"title":"NameserverGroup"}}}}},"400":{"description":"Bad Request","content":{}},"401":{"description":"Requires authentication","content":{}},"403":{"description":"Forbidden","content":{}},"500":{"description":"Internal Server Error","content":{}}},"method":"get","path":"/api/dns/nameservers","servers":[{"url":"https://netbird.io","description":"Default server"}],"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"TokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Prefix the value with \\\"Token\\\" to indicate the custom authorization type"}},"info":{"title":"NetBird REST API","description":"API to manipulate groups, rules, policies and retrieve information about peers and users","version":"0.0.1"},"postman":{"name":"List all Nameserver Groups","description":{"content":"Returns a list of all Nameserver Groups","type":"text/plain"},"url":{"path":["api","dns","nameservers"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET","auth":{"type":"bearer","bearer":[{"type":"any","value":"<Bearer Token>","key":"token"}]}}}
sidebar_class_name: "get api-method"
info_path: api/netbird-rest-api
custom_edit_url: null
---

import ApiTabs from "@theme/ApiTabs";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import TabItem from "@theme/TabItem";

## List all Nameserver Groups



Returns a list of all Nameserver Groups

<div><ApiTabs><TabItem label={"200"} value={"200"}><div>

A JSON Array of Nameserver Groups

</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={false} name={"id"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Nameserver group ID","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={true} schemaName={"string"} qualifierMessage={"**Possible values:** `non-empty` and `<= 40 characters`"} schema={{"description":"Nameserver group name","type":"string","maxLength":40,"minLength":1}}></SchemaItem><SchemaItem collapsible={false} name={"description"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Nameserver group  description","type":"string"}}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>nameservers</strong><span style={{"opacity":"0.6"}}> object[]</span><strong style={{"fontSize":"var(--ifm-code-font-size)","color":"var(--openapi-required)"}}> required</strong></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Nameserver group

</div><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={false} name={"ip"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Nameserver IP","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"ns_type"} required={true} schemaName={"string"} qualifierMessage={"**Possible values:** [`udp`]"} schema={{"description":"Nameserver Type","type":"string","enum":["udp"]}}></SchemaItem><SchemaItem collapsible={false} name={"port"} required={true} schemaName={"integer"} qualifierMessage={undefined} schema={{"description":"Nameserver Port","type":"integer"}}></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem><SchemaItem collapsible={false} name={"enabled"} required={true} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Nameserver group status","type":"boolean"}}></SchemaItem><SchemaItem collapsible={false} name={"groups"} required={true} schemaName={"string[]"} qualifierMessage={undefined} schema={{"description":"Nameserver group tag groups","type":"array","items":{"type":"string"}}}></SchemaItem><SchemaItem collapsible={false} name={"primary"} required={true} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Nameserver group primary status","type":"boolean"}}></SchemaItem><SchemaItem collapsible={false} name={"domains"} required={true} schemaName={"string[]"} qualifierMessage={"**Possible values:** `non-empty` and `<= 255 characters`"} schema={{"description":"Nameserver group domain list","type":"array","items":{"type":"string","minLength":1,"maxLength":255}}}></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"[\n  {\n    \"id\": \"string\",\n    \"name\": \"string\",\n    \"description\": \"string\",\n    \"nameservers\": [\n      {\n        \"ip\": \"string\",\n        \"ns_type\": \"udp\",\n        \"port\": 0\n      }\n    ],\n    \"enabled\": true,\n    \"groups\": [\n      \"string\"\n    ],\n    \"primary\": true,\n    \"domains\": [\n      \"string\"\n    ]\n  }\n]"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>

Bad Request

</div><div></div></TabItem><TabItem label={"401"} value={"401"}><div>

Requires authentication

</div><div></div></TabItem><TabItem label={"403"} value={"403"}><div>

Forbidden

</div><div></div></TabItem><TabItem label={"500"} value={"500"}><div>

Internal Server Error

</div><div></div></TabItem></ApiTabs></div>
      