TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.21k stars 415 forks source link

Question: How to set up custom TLD Resolvers? #1035

Open luigiminardim opened 2 days ago

luigiminardim commented 2 days ago

I'm trying to configure the Technitium DNS Server to resolve queries for a custom top-level domain, .custom-tld. I've added entries to the named.root file to point to my custom resolver, but I'm unsure if this is the correct approach.

# DnsServerCore/named.root

# ...
CUSTOM-TLD.                              3600000      NS   CUSTOM-TLD.
CUSTOM-TLD.                               3600000      A     0.0.0.0 # localhost
#...

Questions

  1. Is this the correct way to configure Technitium DNS Server for a custom TLD?
  2. I've found the zone file to configure the roots (DnsServerCore/named.root) but I wasn't able to figure out where it is being used in source code. so, how can I ensure that the custom resolver is used only for .custom-tld queries and not for other domains?
  3. Are there any specific settings or configurations using Docker-Compose for Technitium DNS Server that I need to adjust for this?

Desired Archtecture

sequenceDiagram
    participant Technitium
    participant custom_tld as Custom TLD
    participant root as Root Server
    Technitium->>custom_tld: Quering any-label.custom-tld
    Technitium->>root: Quering any-label.not-custom-tld
ShreyasZare commented 2 days ago

Thanks for asking. You just need to create a Stub zone for your custom TLD which will allow you to resolve and domain names under it.

You can read issue #272 which shows stub zone creation for OpenNIC TLD.

luigiminardim commented 1 day ago

Thanks for your help! @ShreyasZare! I don't know what I'm doing wrong, but I'm getting this error when I try to add my localhost server as a stub server:

image

It's still not clear how I could turn my local server a TLD nameserver.

ShreyasZare commented 1 day ago

Thanks for the screenshot. You cannot run a custom domain or TLD on non-standard port number. You must configure your DNS server running the TLD zone to use port 53. Once its done, you should be able to create the Stub zone for it. The reason for this is that recursive resolution uses only port 53 and will not work with any non-standard port.

Also note that the primary server for which you enter the IP address for must be authoritative for that domain/TLD. It cannot be just a forwarder/DNS proxy. I am assuming that 0.0.0.0 is just a placeholder IP address for this screenshot.