DNS query fails

  • When 10.0.0.164 is the ip address of the bind server and domain.com is configured in LC with "Own DNS server" with a valid DNS template, then I correctly see in /etc/bind/zones.liveconfig:

    Code
    zone "domain.com" {
    	type master;
    	file "/var/lib/bind/domain.com.db";
    	update-policy { grant LiveConfig. subdomain domain.com. ANY; };
    };


    ... and /var/lib/bind/domain.com.db:


    ... but still the dig command will return:



    Why is it failing? What is missing?

  • At a first glance, the configuration looks valid.
    Please connect to your server via SSH and - as root user - issue the command "rndc reload domain.com". You then should see some log messages in /var/log/messages or /var/log/syslog if and why the zone was rejected by BIND.

  • I tried something else I found in this thread:


    Code
    /usr/sbin/named-checkzone domain.com.db /var/lib/bind/domain.com.db
    /var/lib/bind/domain.com.db:11: ignoring out-of-zone data (domain.com)
    /var/lib/bind/domain.com.db:19: ignoring out-of-zone data (dev.domain.com)
    /var/lib/bind/domain.com.db:20: ignoring out-of-zone data (www.domain.com)
    zone domain.com.db/IN: has 0 SOA records
    zone domain.com.db/IN: has no NS records
    zone domain.com.db/IN: not loaded due to errors.
  • Ok, found it: the sort order of the resource records within the zone file is wrong (the records without a host part (NS, MX) must appear before the other records (dev, www).
    We'll fix this immediately (we'll have to check where this wrong sort order comes from - maybe it depends on the database locale).

  • Please edit the file /usr/lib/liveconfig/lua/bind.lua and remove the two comment dashes from line 604:

    Code
    table.sort(data.rr)


    Then restart LiveConfig, delete your domain and add it again. Then please check if the zone is valid now.


    The behaviour is really strange, as LiveConfig indeed sends the NS records first, but your zone file proves that they "arrive" in a wrong order - without any resorting in between! However, LiveConfig often uses standard structures (eg. arrays from C++ STL), I assume that the different behaviour is hidden here anywhere...

  • Backend is SQLite. I did the change in bind.lua, restarted and switched to external dns and back again. Same result:

  • If you like, you can try this: open or create /usr/lib/liveconfig/lua/custom.lua and add the following line:

    Code
    os.setlocale("C")


    This will (re)set the default sort order, which might also affect the Lua part.
    Then please restart LiveConfig, and delete/add your zone again.

  • has no positive effect. I went to another server with ubuntu 12.04.3 LTS. Same problem. Now when I rewrite the zone file to this format it starts working:

  • Thanks!
    Meanwhile, we have an update available (v1.7.0-r2704) which should fix this issue. We've moved the relevant sorting code to another place which should be more reliable. But I will take a look at your environment settings and try to reproduce this behaviour anyway.


    Best regards


    -Klaus Keppler

  • Well I am afraid we were both mislead. I found out it had to do with the host name of the server, which by force is the host name of the primary DNS in a new template and by force is the hostname of the MX record in a new zone. When in test fase this hostname was just set to something that does not resolve the an IP address. Consequently bind will consider the domain zone invalid and responds to dig queries accordingly.


    When I set in the /etc/hosts the address hostname to the IP address of the server, then suddenly bind considers the zone valid and dig responses correctly.


    Sorry for wasting your time this way, but at least I learned something.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!