Do I need a second domain to run my own authoritative dns server?
from raldone01@lemmy.world to selfhosted@lemmy.world on 10 Apr 2024 10:58
https://lemmy.world/post/14122993

I have a static ip (lets say 142.251.208.110).

I own the domain: website.tld

My registrar is godaddy.

If I want to change my nameserver godaddy won’t allow me to enter a static ip. It wants a hostname. I observed that many use ns1.website.tld and ns2.website.tld.

I don’t understand how this can work because ns1.website.tld would be served by my dns server which is not yet known by others.

Do I need a second domain like domains.tld where I use the registrars dns server for serving ns1.domains.tld which I can then use as the nameserver for website.tld?

I would like to avoid the registrars nameserver and avoid getting a second domain just for dns.

Thank you for your input.

#selfhosted

threaded - newest

linuxdaemon@midwest.social on 10 Apr 2024 11:16 next collapse

I don’t use godaddy, so I’m only guessing here. Have you tried to enter the name (even though there is no way it would find them) and then see if it figures out it can’t look them up and maybe then it’ll prompt for an IP instead?

raldone01@lemmy.world on 10 Apr 2024 11:22 collapse

Which provider do you use? Can you enter an ip there?

hayalci@fstab.sh on 10 Apr 2024 11:24 next collapse

The thing you want is “glue records” the upper level server would serve ns1.example.com (this is an approved domain for example use, better to use example.com than making your own example up) as the authoritative name server. Then provide the glue record which says “ns1.example.com is at IP address X”.

It should ask for IP addresses as well as hostname. Otherwise they only assumed people will “host” their domain in another hosted, as opposed to self-hosting.

In that case (and in any other case) change your registrar to someone else who supports glue records.

hayalci@fstab.sh on 10 Apr 2024 11:25 next collapse

I use porkbun.com for my domains, which is excellent, and also has glue record support.

kb.porkbun.com/…/112-how-to-host-your-own-nameser…

raldone01@lemmy.world on 11 Apr 2024 09:54 collapse

I just switched to porkbun. Saves me about 20EUR per year. Thanks for the tip.

I missed the keyword “glue records”. Ultimately I managed to get my dns server to work but decided against using it for now as the acme plugin is not able to do what I want. github.com/mariuskimmina/coredns-tlsplus/…/2

hayalci@fstab.sh on 13 Apr 2024 15:33 collapse

Yeah porkbun is good.

To see how the glue records work, you can run dig +trace example.com

This answer goes into detail how it works behind the scenes.

superuser.com/…/how-does-dig-trace-actually-work

raldone01@lemmy.world on 11 Apr 2024 09:59 collapse

What do I take if I need more example domains on the second level? Do I use otherexample.com?

hayalci@fstab.sh on 13 Apr 2024 15:24 collapse

RFC 2606 is your friend ;⁠-⁠)

datatracker.ietf.org/doc/html/rfc2606

raldone01@lemmy.world on 24 Apr 06:44 collapse

Just read it. Awesome. Thanks a lot.

ptz@dubvee.org on 10 Apr 2024 11:24 collapse

No, you don’t need a second domain.

You’ll need to register your apex domain with a registrar and then check the option to use custom name servers. The only subdomains you’ll need to configure are the glue records for your ns1 and ns2 name servers.

TCB13@lemmy.world on 10 Apr 2024 16:23 collapse

Assuming you’ve website.tld you just have to create two “child name servers”* eg. ns1.website.tld + ns2.website.tld and set their respective “glue records” (IP addresses). Your register needs to be able to create and publish those to the zone above for it to work. Not sure if that’s the case with yours but it seems to be possible.

* The term “child name servers” is used by some providers to define those kinds of records and it may change from provider to provider.

I don’t understand how this can work because ns1.website.tld would be served by my dns server which is not yet known by others.

That’s because they aren’t served by your DNS server. Remember the “publish those to the zone above for it to work”? What happens is that your domain registrar has to publish your glue record to the TLD zone.

If you run dig +trace +additional google.com SOA you’ll see:

  1. Ding asking a root dns server (xyz.gtld-servers.net) who’s the name server for google.com
  2. Root server will provide you with NS record naming ns4.google.com.
  3. … and also return A record for that name, 216.239.38.10. That’s the “additional” response that serves the glue record.

Then dig will proceed to call 216.239.38.10 and ask what’s the record for google.com. That’s how DNS and glue records work and also why it isn’t a circular dependency like you were thinking it was.

ptz@dubvee.org on 10 Apr 2024 16:32 next collapse

Isn’t that what I said? (genuinely asking). That’s exactly how mine are all setup.

TCB13@lemmy.world on 10 Apr 2024 16:36 collapse

OP asked “Do I need a second domain” you answered “AFAIK, yes.” even though you proceeded to contradict yourself :) Maybe you can remove the “AFAIK, yes.” from the comment?

I actually updated the answer to be more descriptive informative meanwhile.

ptz@dubvee.org on 10 Apr 2024 16:40 collapse

My bad. Didn’t see “second” domain.

TCB13@lemmy.world on 10 Apr 2024 16:44 collapse

NP. Updated accordingly.

raldone01@lemmy.world on 11 Apr 2024 09:55 collapse

Thanks for a all the details. Makes perfect sense. I got it to work!