How do I set up a DNS server on my Synology NAS?
How do I set up a DNS server on my Synology NAS?
Purpose
This article gives you an overview of DNS and detailed instructions on how to set up a DNS server on Synology NAS.
Resolution
What is DNS?
The Domain Name System (DNS) functions similarly to an Internet address book. It maps meaningful domain names with IP addresses, allowing users to easily access web pages, computers, and other resources across networks.
The process of searching for IP addresses is called DNS lookup. When you visit a website by entering its domain name (e.g., www.synology.com) into a web browser, your browser queries one or more DNS servers to find the corresponding IP address of the website (e.g., 120.89.71.100).
When should I use Synology's DNS Server?
If you have a registered domain name and host servers for web, FTP, or mail services, you will probably want guests to be able to access your services using your domain names, instead of remembering a bunch of long IP addresses. In this case, you can use Synology's DNS Server package to translate your domain names into corresponding IP addresses of your servers.
Set up a DNS server
Complete the following steps to set up a DNS server. For more information, refer to Help articles.
- Install DNS Server: On DSM, launch Package Center and install DNS Server.
- Obtain a fixed, public IP address: To set up a public DNS service, you need to acquire a fixed IP address for your Synology NAS. Consult your domain provider for more information.
- Register a domain name: Setting up an authoritative DNS service requires registering a domain name with a domain name provider. For example, if you want to use a domain called "example.com," you need to register the domain "example" with the domain provider of ".com". Once your registrar1 notifies that your domain name is registered, you can create a primary zone for the domain on Synology's DNS Server.
- Check firewall or port forwarding settings: DNS services require the use of TCP/UDP port 53. If your Synology NAS uses a firewall, this port must be opened. If the NAS connects to the Internet through a router, set up port forwarding rules and open TCP/UDP port 53.
- Register your device: Remember to register the IP address and other required information of your Synology NAS with your domain provider.2 Otherwise, clients will not be able to query your Synology NAS over the Internet. Consult your domain provider for more information.
- Change router settings: To set up a DNS server for your local network, you have to change the DNS server settings on your router or your client device so that Synology's DNS Server can be queried. For more information, please consult the manual of your router or client device.
Once you've installed DNS Server and your environment meets the requirements above, you need to configure some settings before providing DNS service for your domain. First, we'll start by creating a primary zone.3
- On DSM, go to DNS Server > Zones and click Create > Primary zone.
-
Complete the following settings:
- Domain type: Select Forward Zone to perform resolution services from domain name to IP address.
- Domain name: Enter your registered domain name (e.g., synoproduct.com).
- Primary DNS server: Enter the fixed, public IP address that your Internet service provider (ISP) assigned to you (e.g., 59.124.41.242). Guests will be directed to this IP address when querying your DNS Server for the domain name above.
- Serial format: Choose a format for the serial number of zone records between two options – Integer (0 - 4294967295) or Date (YYYYMMDDNN) (e.g., "2015043001").
- Once you click Save, the new primary zone will appear on the Zones page. You have now set up a basic DNS server on your Synology NAS.
When you create a primary zone, DNS Server will automatically create three resource records: a Name Server (NS) record, a Host (A) resource record, and a Start of Authority (SOA) record. Right-click the primary zone and click Resource record to check the NS and A resource records.
In this screenshot, the NS resource record identifies the domain name server that you give to your registrar or your DNS service so that queries can be routed to your Synology NAS. The A resource record maps a domain name to an IP address. In the example above, DNS Server will resolve queries for "ns.synoproduct.com" to "59.124.41.242".
4. Create a resource record: CNAME as an example
Create a CNAME resource record to redirect guests to "www.synoproduct.com" when they query "ns.synoproduct.com".
- Select your zone, click Edit > Resource record.
- Click Create to add a new resource record. In this example, we'll create a CNAME resource record.
-
Enter the following details and save the settings:
- Name: Enter a name for the resource record.
- TTL: Choose how long the resource record remains in the cache of other domain name servers.
- Canonical name: Enter the host into which the name entered above should translate. In the example below, we want visitors to be redirected to "ns.synoproduct.com" when they query "www.synoproduct.com", so we'll enter "ns.synoproduct.com" in this field.
- Now browsers will be redirected to the website you specified when querying your DNS Server.
Notes:
- To register your domain name, you can visit the ICANN website to get a list of domain registrars.
- Depending on settings for your domain provider's servers, changes to DNS resolvers can take effect in about 48 hours or more.
- A primary zone stores name information regarding one or more DNS domains. It serves as an authoritative source for information regarding each included domain name.