I am interested in running my own DNS servers to make it easy to make updates to my domains' A-records. I am aware of the warnings of having my webserver and dns server on the same domain.

Currently my domains are registered through GoDaddy and I have registered two subdomains (ns1... and ns2...) and have them both pointing to my IP address. My desire was to be able to open port 53 and essentially have all requests for my domain query my IP:53, to which I would serve the A-record. Please excuse me if I am over-simplifying the process as it is admittedly complex and I am still learning the domain name resolution algorithm.

Ultimately I wanted to build my own DNS server using NodeJs, but when I followed the above preliminary steps, I discovered that even if I were to listen on port 53, I would get no traffic if I made requests to my domain through a browser. My router has been configured correctly to forward requests on Port 53 to my in-network server.

What could be the cause for this?

EDIT: I had this question posted in the wrong place (serverfault) for some time and got some advice but which is still unclear to me. It was suggested to me that I needed to update my NS records to point to the new nameservers, but I'm fairly certain that this was implicitly done when I set the nameservers to be my own. Are not all of the records now supposed to be served by my nameservers? Is the NS record one which remains always needing to be served from the registrar?

Another suggestion I got was that the nameservers needed to have A-records resolving to their IP address. Again, is GoDaddy the necessary party which needs to serve this A-record?

I also was told that DNS is "heavily cached" and so the browser doesn't connect directly but asks the OS for a DNS lookup. So, after notifying GoDaddy of the change to my domain's nameservers (to use my own) and after having once tried to request my domain (through my browser), what I would like to know is if the DNS request theoretically would've landed at port 53 of my nameserver IP?

  • A possible issue is that the router is itself a DNS server, and so even if you forward udp/53 internally, then it won't happen as the router will attempt to answer the query itself. Does your router have a way to disable its dns server? – Paul Nov 25 '15 at 23:28
  • 1
    Perhaps your ISP is blocking incoming DNS. It wouldn't be entirely unreasonable since UDP DNS requests can be abused for DDoS Amplification. us-cert.gov/ncas/alerts/TA13-088A blog.cloudflare.com/deep-inside-a-dns-amplification-ddos-attack – Zoredache Nov 25 '15 at 23:39
  • @Paul & Zoredache, that's entirely possible. I'll have to take a peek at my router's config tonight. – user305964 Nov 25 '15 at 23:43
  • Well the problem I mentioned wouldn't be in YOUR router configuration. It would be configured in your Internet Provider's firewall. There would be nothing you could do to change the setting. You might need to try to your ISP tech support. Of course they might point at you to a section in your usage agreement saying that running servers is against the terms. Of course this would be different if you are paying for business class service. – Zoredache Nov 25 '15 at 23:46

My apologies for saying this - I think you are going about this the wrong way (because of the long-windedness of the post).

A "better" way of solving this problem would be to (1) set up nameservers, (2) Check that they are answering locally, (3) Check they are answering from outside your network and then (4) point the domain name at them.

Note that you really need a minimum of 2 nameservers, and these should either be on different networks or on highly reliable networks. You really want the nameservers to have different externally reachable IP addresses - something you can't typically do from a home/consumer-grade connection.

To answer your question "What could be the cause for this?" is difficult - however most likely if you are querying your nameserver from your LAN on its external address, your router is not able to route the packets correctly.

Your namesevers definately need A records to resolve them - and if your DNS records are a subdomain you are trying to use its even harder - you need "glue records" (although many providers make this as easy as typing in the IP address next to the dns server). Where the A record is modified depends on your setup - if the domain name is example.com and the nameserver is dns1.example.com, then this needs to be set up on dns1.example.com. The A record needs to be modified in the zone file for the domain name.

DNS does rely heavily on caching, but may or may not be heavily cached. If the nameservers you are querying have received a query for the record recently, and you are not directly querying the Godaddy servers (and its unlikely you are, as they will only answer for domain names they are authorative for), then yes, it may well be cached. (This is a gross oversimplification, but nets the correct answer.)

  • In reading over my "question", I can see that it is rather long-winded. I think that observation was really the correct answer and I will have to reexamine how I begin this. Bottom-up instead of top-down, it seems. Thanks! – user305964 Nov 26 '15 at 1:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.