Check zones with underscores in host names (A Records)

Jack Tavares j.tavares at F5.com
Tue Feb 12 11:29:03 UTC 2008


 

> -----Original Message-----
> From: Haim [Howard] Roman [mailto:roman at jct.ac.il] 
> Sent: Tuesday, February 12, 2008 3:12 AM
> To: Jack Tavares; bind-users at isc.org
> Subject: Re: Check zones with underscores in host names (A Records)
> 
> We also have to allow underscores (good old Microsoft!).  Here is what
> we have in our /etc/named.conf:
> 
> 
>     options {
>     ...
> 
>     #---------------------------------------------------------
>     # turn off name checking.  We have too many host names with
>     # underscores, plus all the MS AD records we get from others.
>     # Anyway, while RFC 1123 forbade underscores, RFC 2181 allowed
>     # it *& maybe other characters.  (roman 2007/12/05)
> 
>     check-names master ignore;
>     check-names slave  ignore;
> 

That doesn't help me.
If i set the check-names master ignore and run named-checkzone on the
same
file as I showed below it get

named-checkzone test.com. db.test
db.test:14: under_score.test.com: bad owner name (check-names)
zone test.com/IN: under_score.test.com/NS 'unknown.test.net' (out of
zone) has no addresses records (A or AAAA)
zone test.com/IN: loaded serial 8
OK

With no error code. That means I still have to parse the log messages to
get the error
on the NS record.

If I call it with
named-checkzone -kfail test.com. db.test
db.test:14: under_score.test.com: bad owner name (check-names)
zone test.com/IN: loading from master file db.test failed: bad owner
name (check-names)

It still craps out on the first erorr (the underscore) and doesnt tell
me about
the NS recored

If I call it with 
named-checkzone -ifull test.com. db.test
db.test:14: under_score.test.com: bad owner name (check-names)
zone test.com/IN: under_score.test.com/NS 'unknown.test.net' (out of
zone) has no addresses records (A or AAAA)
zone test.com/IN: loaded serial 8
OK

I get the error message about the NS record, but still with a return
code of 0, so I still
have to check the log messages.

So


> -------- Original Message  --------
> Subject: Check zones with underscores in host names (A Records)
> From: Jack Tavares <j.tavares at F5.com>
> To: bind-users at isc.org
> Date: Tue Feb 12 2008 12:57:13 GMT+0200 (IST)
> > Hello -
> >  
> > I use named-checkzone to check for zone validity.
> >  
> > However, named-checkzone will complain if there is an "_" 
> in the domain label of an A Record.
> >  
> > I need to allow for underscores in A records, but I still 
> want to check for other errors.
> >  
> > It seems to me that the only way to do that would be to 
> parse the error/warning strings
> > to separate errors that I want to ignore (underscores) and 
> catch errors that I care about.
> >  
> > Is there any other way to do this?
> >  
> > Example, given this zone file
> > $ORIGIN .
> > $TTL 500        ; 8 minutes 20 seconds
> > test.com                IN SOA  d62.test.net. 
> hostmaster.d62.test.net. (
> >                                 8          ; serial
> >                                 10800      ; refresh (3 hours)
> >                                 3600       ; retry (1 hour)
> >                                 604800     ; expire (1 week)
> >                                 60         ; minimum (1 minute)
> >                                 )
> >                         NS      d62.test.net.
> > $ORIGIN test.com.
> > under_score             A 1.2.3.4
> >                                NS unknown.test.net.
> >  
> > calling named-checkzone thusly
> >  
> > named-checkzone test.com. db.test
> > returns
> > db.test:14: under_score.test.com: bad owner name (check-names)
> > zone test.com/IN: under_score.test.com/NS 
> 'unknown.test.net' (out of zone) has no addresses records (A or AAAA)
> > zone test.com/IN: loaded serial 8
> > OK
> > with a return code of 0
> >  
> > Calling with
> > named-checkzone -kfail test.com. db.test
> > returns
> > db.test:14: under_score.test.com: bad owner name (check-names)
> > zone test.com/IN: loading from master file db.test failed: 
> bad owner name (check-names)
> > [root at d35:Active] namedb # echo $?
> > 1
> >
> > It returns an error code of "1", but stops after the first error.
> >  
> > calling with
> >  
> > named-checkzone -kfail -ifull test.com. db.test
> > also stops at the first error.
> >  
> > using
> > named-checkzone -kwarn -ifull test.com . db.test
> > gives
> > db.test:14: under_score.test.com: bad owner name (check-names)
> > zone test.com/IN: under_score.test.com/NS 
> 'unknown.test.net' (out of zone) has no addresses records (A or AAAA)
> > zone test.com/IN: loaded serial 8
> > OK
> >
> > returns an error code of 0 (ok) but logs messages.
> >  
> > So, to do what I want to do,
> > I have to basically ignore the return code and parse the 
> output messages to see if something has
> > gone wrong.
> >  
> > Am I missing an easier way to do this?
> >  
> > Thanks
> >  
> > --
> > jack
> >  
> >  
> >  
> >
> >
> >   
> 
> 
> 



More information about the bind-users mailing list