Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cleaning up DNS zone files...

437 views
Skip to first unread message

Forrest Aldrich

unread,
Jan 18, 2007, 12:37:06 PM1/18/07
to
I've inherited a slew of DNS zonefiles which need to be cleaned up -
mostly formatting.

I can use tools like dnslint to indentify errors; however, I wonder if
someone has a slick hack (script, regex) that can be utilized to run
through and reformat the zonefiles (forward and reverse) to get them in
order and tidy.


Thanks.

Dawn Connelly

unread,
Jan 18, 2007, 12:51:34 PM1/18/07
to
If the zones are fully operational, do a zone transfer to a different
machine and poof- the file is correctly formatted. Import the data (minus
the header obviously) and you are done.
</end two cents>

Edward Lewis

unread,
Jan 18, 2007, 12:56:05 PM1/18/07
to
At 12:37 -0500 1/18/07, Forrest Aldrich wrote:
>I've inherited a slew of DNS zonefiles which need to be cleaned up -
>mostly formatting.
>
>I can use tools like dnslint to indentify errors; however, I wonder if
>someone has a slick hack (script, regex) that can be utilized to run
>through and reformat the zonefiles (forward and reverse) to get them in
>order and tidy.

Load the file into a server and try dig @server <zone> axfr. The
AXFR output will be a nearly correctly formatted file. The gotcha is
the last record - the terminating SOA RR. Remove that plus the other
commented ("^;;") lines and you will have a zonefile.

'Course, you may not be happy with that format, but it is a "correct" format.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Edward Lewis +1-571-434-5468
NeuStar

Dessert - aka Service Pack 1 for lunch.


Peter Dambier

unread,
Jan 18, 2007, 1:12:47 PM1/18/07
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you can afford a spare DNS-server, serve the file on one server
and slave it to the other.

The slave file is perfect and looks better than "dig axfr".
No need to delete the 2nd SOA entry.

If you can slave on your master then you can slave directly to
the place you need them. Just turn slave into master when you
are done and comment or delete the "masters" entry.

Kind regards
Peter and Karin


Forrest Aldrich wrote:
| I've inherited a slew of DNS zonefiles which need to be cleaned up -
| mostly formatting.
|
| I can use tools like dnslint to indentify errors; however, I wonder if
| someone has a slick hack (script, regex) that can be utilized to run
| through and reformat the zonefiles (forward and reverse) to get them in
| order and tidy.
|
|

| Thanks.
|
|


- --
Peter and Karin Dambier
Cesidian Root - Radice Cesidiana
Rimbacher-Strasse 16
D-69509 Moerlenbach-Bonsweiher
+49(6209)795-816 (Telekom)
+49(6252)750-308 (VoIP: sipgate.de)
mail: pe...@peter-dambier.de
mail: pe...@echnaton.serveftp.com
http://iason.site.voila.fr/
https://sourceforge.net/projects/iason/
http://www.cesidianroot.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQFFr7icPGG/Vycj6zYRAsBtAJoC3NpQvp2UZ8wn4jkdrJBI+6ucrwCfX9Gr
yl1KrGpSBqHtb263mlbsmhI=
=dzUT
-----END PGP SIGNATURE-----


Sebastian E. Castro Avila

unread,
Jan 18, 2007, 3:14:13 PM1/18/07
to
On Thu, 18 Jan 2007 14:37:06 -0300, Forrest Aldrich <for...@forrie.com>
wrote:

> I've inherited a slew of DNS zonefiles which need to be cleaned up -
> mostly formatting.
>
> I can use tools like dnslint to indentify errors; however, I wonder if
> someone has a slick hack (script, regex) that can be utilized to run
> through and reformat the zonefiles (forward and reverse) to get them in
> order and tidy.
>

Or you can try to use "named-checkzone" with -D option (Dump zone file in
canonical format) and -o <filename> option (Write zone output to
<filename>) to get the same result.

Kind Regards
>
> Thanks.
>
>
>

--
Sebastian E. Castro Avila seba...@nic.cl
Administrador de DNS, NIC Chile


0 new messages