0

I'm already hosting my own web server, FTP, etc. and I want to be able to link my domain name myself directly instead of configuring all subdomains and redirections on the registrar's DNS. Is it possible to do this with bind9? I've looked and tried many things, but nothing seems to work.

My situation right now:

My registrar's DNS has all my subdomains:

  • www.example.com
  • ftp.example.com
  • etc.

They all redirect to my public IP, and my router is configured to let the necessary ports go through. The problem is that I can't "loopback" to my own subdomains as they are pointing in the same direction. The Internet can connect to them though.

The situation I want:

My own DNS has all my subdomains:

  • www.example.com
  • ftp.example.com
  • etc.

My registrar only has a pointer to my DNS. The Internet "knows" about my DNS and can resolve my subdomains. My local network is already in the same network as my DNS and resolves locally to the subdomains, and can access the Internet.

My question is: Is this possible to do? If so, how?

  • 2
    With respect, this is looking a bit like an XY problem. You start by saying you want to host your own DNS, which is eminently possible, but end up talking about accessing external IPs which are punched through into your LAN, from inside that LAN (also known as hairpin NAT) - which, whilst also possible, has nothing to do with hosting your own public DNS. What problem are you actually trying to solve? – MadHatter Feb 07 '16 at 15:32
  • You are right, I may be a bit confused because I don't really know "what to ask" exactly.

    My problem is that I can't access my own website from within my own network because their subdomains are pointed towards my own public IP, and somehow, my router does not like that.

    Also, my other problem is that I want to have complete control over the DNS records I make for my domain name, and my registrar does not allow me to do TEXT records, for example.

    – BinarMorker Feb 07 '16 at 16:15
  • 1
    Then If I were you I'd follow the link above about hairpin NAT and read the answers there, because that's exactly what you're trying to do. As for hosting your public DNS yourself, yes, it's perfectly possible, but I think it's way too broad a question for SF: books can, and have, been written on how to do it. – MadHatter Feb 07 '16 at 16:17
  • To add to what @MadHatter said, if your issue with DNS hosting is that you are hosting your records at your registrar but don't like their options or control panel, just choose another DNS host with the options you want (Rackspace, AWS, etc) and point your NS records at your registrar to them. – phoebus Feb 07 '16 at 17:42
  • Would that be better than hosting the DNS server myself? It really doesn't solve my local loopback problem, only my DNS options problem. – BinarMorker Feb 07 '16 at 18:52
  • Take a look at http://serverfault.com/a/555333/200560 or split dns – Jacob Evans Feb 07 '16 at 19:55

1 Answers1

0

If I understand correctly, you want to resolve your domains to public IP addresses for the clients that reach them through WAN, and to local IP addresses for your LAN clients, that reach your domains through LAN.

If so, then yes, it's possible with named and it's called views.

Check this article for examples: Understanding views in BIND 9, by example

drookie
  • 8,759