--- id: create-a-nameserver-group title: "Create a Nameserver Group" description: "Creates a Nameserver Group" sidebar_label: "Create a Nameserver Group" hide_title: true hide_table_of_contents: true api: {"description":"Creates a Nameserver Group","tags":["DNS"],"security":[{"BearerAuth":[]},{"TokenAuth":[]}],"requestBody":{"description":"New Nameserver Groups request","content":{"application/json":{"schema":{"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"}}}},"responses":{"200":{"description":"A Nameserver Groups Object","content":{"application/json":{"schema":{"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":"post","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"}},"jsonRequestBodyExample":{"name":"string","description":"string","nameservers":[{"ip":"string","ns_type":"udp","port":0}],"enabled":true,"groups":["string"],"primary":true,"domains":["string"]},"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":"Create a Nameserver Group","description":{"content":"Creates a Nameserver Group","type":"text/plain"},"url":{"path":["api","dns","nameservers"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}},"auth":{"type":"bearer","bearer":[{"type":"any","value":"","key":"token"}]}}} sidebar_class_name: "post 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"; ## Create a Nameserver Group Creates a Nameserver Group
Request Body
New Nameserver Groups request
    nameservers object[] required
    Nameserver group
  • Array [
  • ]
A Nameserver Groups Object
Schema
    nameservers object[] required
    Nameserver group
  • Array [
  • ]
Bad Request
Requires authentication
Forbidden
Internal Server Error