Rapid DNS Zone serial update
July 2017
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
About
This site is an effort to share some of the base knowledge I have gathered through all this years working with Linux, FreeBSD, OpenBSD, Python or Zope, among others. So, take a look around and I hope you will find the contents useful.
Recent Entries
Recent Comments
Recent Trackbacks
Categories
OpenBSD (9 items)
BSD (0 items)
FreeBSD (19 items)
Linux (3 items)
Security (3 items)
Python (22 items)
Zope (13 items)
Daily (144 items)
e-shell (9 items)
Hacks (14 items)
PostgreSQL (3 items)
OSX (8 items)
Nintendo DS (0 items)
enlightenment (0 items)
Apache (3 items)
Nintendo Wii (1 items)
Django (24 items)
Music (12 items)
Plone (7 items)
Varnish (0 items)
Lugo (2 items)
Sendmail (0 items)
europython (7 items)
Cherokee (1 items)
self (1 items)
Nature (1 items)
Hiking (0 items)
uwsgi (0 items)
nginx (0 items)
cycling (9 items)
Networking (1 items)
DNS (0 items)
Archives

Syndicate this site (XML)

RSS/RDF 0.91

27 febrero
2009

Rapid DNS Zone serial update

a one-liner again, I really like these ones!

Today, while doing a DNS server migration, I found myself having to update a bunch of DNS zone files. First, I had to change the ip address for some records in every zone file (as the DNS server is a web server too, so moving the server means I had to move every web service there too). That was pretty easy (as I've done it before).

But then I realized I had to update the serial code for each zone file too, and that would be a little bit tricky, as each zone had a different serial code. Of course, sed to the rescue again!, the one-liner:

sed -i.bak '/serial/s/[0-9][0-9]*/2009022701/' *

and et voilá, all the serial codes are changed into 2009022701, doing a .bak backup of the file before changing it. Basically, it search for lines that match the serial term and then it replaces each numeric code with the new one.

(borrowed from here)

Posted by wu at 19:44 | Comments (0) | Trackbacks (0)
<< ¿buscas trabajo? (necesitamos desarrolladores) | Main | Poll: your oppinion about the best setup... >>
Comments
There are no comments.
Trackbacks
Please send trackback to:http://blog.e-shell.org/142/tbping
There are no trackbacks.
Post a comment