Setting up custom name servers causing issues

Discussion in 'Server Operation' started by ShaferTech, Nov 15, 2022.

  1. ShaferTech

    ShaferTech New Member

    To setup custom name servers for a domain, i usually create an ns1 and ns2 entry point to the ips of my isp servers. I've always done this and it's never been a problem. Until today.
    let's say it's domain.com and the ips of my servers are 1.1.1.1 and 1.1.1.2
    so I have:
    A .domain.com 1.1.1.1
    A .domain.com ns1 1.1.1.1
    A .domain.com ns2 1.1.1.1
    NS .domain.com ns1.domain.com
    NS .domain.com ns2.domain.com

    However i'm getting this warning emailed to me when it tries to save this and restart named
    Code:
    WARNING - Writing BIND domain file failed: /var/named/pri.domain.com zone domain.com/IN: NS 'ns1.domain.com.domain.com' has no address records (A or AAAA) zone domain.com/IN: NS 'ns2.domain.com.domain.com' has no address records (A or AAAA) zone domain.com/IN: not loaded due to errors.
    Why is it trying to add the domain.com to the end of the record again? So I am obviously doing something wrong. This is how i've setup almost every domain since i started using ISP config 3 years ago.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You missed adding some dots. Any fully qualifued domain name on a BIND server must end with a dot. If the dot is missing, then BIND adds the zone name.

    Wrong:

    Code:
    A .domain.com 1.1.1.1
    A .domain.com ns1 1.1.1.1
    A .domain.com ns2 1.1.1.1
    NS .domain.com ns1.domain.com
    NS .domain.com ns2.domain.com
    correct:

    Code:
    A domain.com. 1.1.1.1
    A ns1 1.1.1.1
    A ns2 1.1.1.1
    NS domain.com. ns1.domain.com.
    NS domain.com. ns2.domain.com.
    So the short form is without a dot, e.g. "ns1" while the long form is with a dot at the end, e.g. "ns1.domain.com.".
     
  3. ShaferTech

    ShaferTech New Member

    The dots are at the end, I typed it wrong. But in the dns entries they're correct.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The dots are not correct according to the error message you posted. Check it again:

    Code:
    WARNING - Writing BIND domain file failed: /var/named/pri.domain.com zone domain.com/IN: NS 'ns1.domain.com.domain.com' has no address records (A or AAAA) zone domain.com/IN: NS 'ns2.domain.com.domain.com' has no address records (A or AAAA) zone domain.com/IN: not loaded due to errors.
    As you can see, BIND reports a domain "ns1.domain.com.domain.com" which means you missed adding a dot after ns1.domain.com
     
    ShaferTech likes this.
  5. ShaferTech

    ShaferTech New Member

    just found it, then saw your post but it was missing the dot.

    What's odd is at some point ISPconfig must have added that for me, because other entries I know i didn't add it and they have the "." at the end. Then some didn't. :confused:
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    This has not been changed in ISPConfig since the DNS module exists. What might be is that you manually altered e.g. the template used by the DNS wizard to create new zones and the dots are missing in this altered template.
     
  7. ShaferTech

    ShaferTech New Member

    Where is that template? I wouldn't have changed intentionally
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    In the DNS module, there is just one entry in the menu on the left side regarding templates.
     
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    My signature has link to DNS setup tutorial.
     

Share This Page