1

I'm a bit struggling with using a domain to connect a domain with my server. First of all, I'm using a Debian Linux(of course actually Raspbian, because the server is running on Raspberry Pi 3).

Let's suppose my domain is lalala.co.kr(bought from a domain provider) and my IP is 1.1.1.1. I found that Raspberry Pi can have a DNS server, but I don't think the DNS will help establishing connection with those(domain and IP).

To explain, My domain provider has some of 'name servers'. They have 'Change name server' option for a domain, and if I use their 'name servers' and make some A records for 'name server hosting' then I can make a connection with those.

However I cannot come up with configuring 'name server' and making A records in Raspberry Pi's own.

Let's suppose that the domain provider's name server IP is 2.2.2.2. How can I solve this problem? I want to not use the domain provider's default name server config, because this cause some money expenses. I'm really confused with some networking concepts. I'll appreciate for some intuitions for solving this problem. The server can be connected by using direct IP connection(which means the server is externally open for some web ports and DNS port).

If I gave insufficient informations, please ask to provide them.

0

I don't think the DNS will help establishing connection with those(domain and IP).

That's actually literally what DNS does.

To explain, My domain provider has some of 'name servers'. They have 'Change name server' option for a domain, and if I use their 'name servers' and make some A records for 'name server hosting' then I can make a connection with those.

However I cannot come up with configuring 'name server' and making A records in Raspberry Pi's own.

A 'name server' is a DNS server. You can use software such as BIND 9, PowerDNS, Knot, or NSD to host your own nameserver.

  1. First install the DNS server software and create a new 'zone' for your domain.

  2. Create a 'zone file' that contains your A/AAAA/NS/etc. records. Don't forget to add an NS record pointing to the Pi's hostname. For example:

    $ORIGIN example.com.
    
    @     SOA   ...
    @     NS    mypi
    mypi  A     192.0.2.1
    mypi  AAAA  ...
    

    (Some programs can keep the DNS records in a database, if you want, but nearly all of them also support a plain text-based format.)

  3. Test from outside, by using such commands as dig @<your_ip> example.com or nslookup example.com <your_ip>.

  4. Go to your domain registrar's "Change name server" page and enter your Pi's hostname there (e.g. mypi.example.com). Because it's under the same domain, you also need to enter its IP address alongside, thus creating a "glue record". For example:

  5. Wait a while for the registrar to submit your changes to the registry, and for the registry to update their nameservers, and for old cached entries on your ISP's resolvers to expire...

    This might take anywhere from minutes to several days. You can use a tool like dnstrace -s . example.com to check whether the nameserver information has been updated. (A web version is available through "DNS Auth Trace" in this page.)

You now have a self-hosted domain.

  • I made a quite good DNS server with your answer but I think actually the domain port is blocked(used WireShark but the WS got no response from any other external computers). Anyway I configured the server successfully and I will have to find the solution for 53 port issue. Thank you. – Chanho Jeon Jan 22 at 10:40
  • Check your router first (DNS is primarily UDP-based, so if you use port-forwarding, be sure to forward TCP 53 and UDP 53). And try calling your ISP, they might be preemptively blocking it to avoid "open resolver" problems. – grawity Jan 22 at 11:17

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.