open.itworld.com
  Search  
Security Home Page Security Webcasts Security White Papers Security Newsletters Security News Open Topics Careers ITworld Voices ITwhirled The Security site of ITworld.com

Unix Tip: Cleaning up DNS

ITworld.com 6/15/2007

Sandra Henry-Stocker, ITworld.com

Send in your Unix questions today! | See additional Unix tips and tricks

I recently had an occasion to help a friend update her DNS configuration on a system responsible for a small test domain. Since she seldom touches the zone files on the server, never mind the main configuration file, I suggested that we pay attention to the messages that the process writes to the messages file to highlight any configuration problems that existed in the long neglected named.conf file.

While we didn't run into many problems and the DNS server was working, we noted a number of minor configuration problems -- some resulting in errors and others generating warnings -- which we systematically identified and then resolved.

The first error we noticed was this one:

Jun 19 09:09:09 ns named[6226]: [ID 295310 daemon.error] /etc/named.conf:12:
syntax error near '('
This mistake was a little hard to spot on the screen since parentheses and braces look very similar on a screen when a small font is used. The particular problem was that a parenthesis was used where a brace was needed. Once we made this change, we restarted in.named with a "pkill -HUP in.named" command and noticed that the error was no longer being generated.

The second error we encountered told us that the allow-query option was being used in a location where it didn't apply. In this case, it was included in a forward zone.
Jun 19 09:09:09 ns named[6226]: [ID 295310 daemon.error] 'allow-query' option
 for non-{master,slave,stub} zone 'dditch.com'
We were also getting an error associated with that same forward zone saying that it was being skipped because it failed to validate. We figured this was related to the initial problem and moved on to the next error.

The third problem we encountered took a little longer to resolve. The error messages looked like this:
Jun 19 09:09:09 ns named[6226]: [ID 295310 daemon.error] /etc/named.conf:57:
syntax error near '}'
As it turned out, one of the allow-transfer commands in the named.conf file was incorrectly formatted. It looked like this:
	        allow-transfer {10.1.2.3;10.1.2.4};
It should have looked like this:
	        allow-transfer {10.1.2.3;10.1.2.4;};
Notice the additional semicolon before the closing brace.

I sometimes format allow-transfer and similar commands across multiple lines so that they're a little easier to read:
        allow-transfer {
                10.1.2.3;
                10.1.2.4;
                };
The absence of the semicolon when the command is spread across multiple lines is a little easier to spot.

Two warnings appeared in the messages file regarding the assumed default time to live (TTL). These messages looked like this:
Jun 19 09:09:09 ns named[6226]: [ID 295310 daemon.warning] Zone "dditc
h.com" (file db.annlab.dditch.com): No default TTL ($TTL <value>) set, u
sing SOA minimum instead.
These were easily resolved by inserting a "$TTL 2d" (time to live set to 2 days) command at the tops of the two offending zone files.

Once these issues were resolved, the only messages generated when we sent in.named a hangup to restart DNS were two lines telling us that named was reloading and was then ready to answer queries.
Jun 19 16:39:12 ns named[6370]: [ID 295310 daemon.notice] reloading nameserver
Jun 19 16:39:12 ns named[6370]: [ID 295310 daemon.notice] Ready to answer queries.
If you would like to see even more information from DNS, you can add debugging by specifying the -d option (e.g., /usr/sbin/in.named -d 9)

The named process might not issue warnings in your terminal window when you restart it with a "pkill -HUP in.named" command. However, it sends useful messages to the /var/adm/messages file which you should check from time to time to make sure you're not overlooking some problems that might affect how well your name server is actually working.

On this topic

 

Sandra Henry-Stocker has been administering Unix systems for more than 18 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She currently works for TeleCommunication Systems, a wireless communications company, in Annapolis, Maryland, where no one else necessarily shares any of her opinions. She lives with her second family on a small farm on Maryland's Eastern Shore. Send comments and suggestions to bugfarm@gmail.com.




Sponsored Links

Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
Sun Microsystems' - FREE 60 DAY TRIAL OFFER!
Test Sun's Newest Servers BEFORE YOU BUY. Plug Them In With Access To Full Technical Support.
100% Web Based Help Desk Software
Easy to use, customizable to meet your needs, powerful and scalable. Free online demo. Try it today!
Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
Used and Refurbished HP ProCurve Switches
Lifetime Warranties, Professional Testing & Shipping on all HP Equipment Purchases!
» Buy a link now

Advertisements
Sponsored links
Locate Hidden Software on business PCs with this free tool
Bring harmony to your mix of UNIX-Linux-Windows computing environments
Top 5 Reasons to Combine App Performance and Security
KODAK i1400 Series Scanners stand up to the challenge
 Home   Open source  Operating systems  Unix
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   IDG Connect   IDG World Expo   Infoworld   ITworld   JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.