[bug] bind, manual entries broken by changes

Discussion in 'Developers' Forum' started by rachel, Dec 23, 2008.

  1. rachel

    rachel New Member

    In a primary DNS zone file I've made a manual entry below the line saying ";;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;; and it gets modified when the file is rewritten after making a change to the zone in the web interface.

    The change is that it strips leading whitespace from lines in the manual entries section.

    The problem is that the line I have in that section is a third NS record (because ISPConfig only allows entry of two), and if that leading whitespace is stripped out, the whole zone then fails to load when bind is restarted - and I find out about it about a week later when all my hosts suddenly stop resolving as the backup nameservers time out.

    Fix required: Make sure the manual entries section is preserved utterly verbatim, do not even strip leading whitespace from lines. :)
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You have to add a newline after the last record and not a whitespace.
     
  3. rachel

    rachel New Member

    No, the whitespace that gets stripped is at the *start* of the record.

    This is what I put in, which works fine:

    Code:
    administrator@hinzelmann:~$ cat /etc/bind/pri.strangenoises.org
    $TTL        86400
    @       IN      SOA     ns0.strangenoises.org. admin.strangenoises.org. (
    
    ... etc, etc ...
    
    ;;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;;
    
    
    
    
            NS	ns2.strangenoises.org.	; because ispconfig only lets us enter two
    
    
    administrator@hinzelmann:~$ 
    (Note also newlines *after* the record.)

    The bug is that the spaces on the NS line *before* the NS get stripped out when ISPConfig regenerates the file, and then the zone file is invalid.

    So every time I change this zone in ISPConfig I then have to manually edit the file and re-insert those spaces and restart bind before the zone will work again.

    You're presumably spooling the contents of the file below the MAKE MANUAL ENTRIES line from the old version of the file to the end of the new one, line by line, and - this is the mistake - you're trimming the not-so-superfluous spaces from the start of each line in the process. You're probably trimming from the end too, but there they really would be superfluous.

    NS at the very start of a line in a zone file means the whole zone fails to load when bind is reloaded. But ISPConfig doesn't report the error, it sits silently until any and all backup nameservers have expired and then the domain stops resolving for the world.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please enter your lines in the full notation like this:

    strangenoises.org. NS ns2.strangenoises.org. ;

    I will post the issue to the bugtracker.
     

Share This Page