Best approach to edit linux configuration file

Himanshu Garg hgarg.india at
Fri Nov 15 14:05:54 CET 2013

I have to setup the DNS server.  For this I have to edit the configuration files.

For this I have to search if the lines(block of text) already exist in the file and if not, I have to add them to the file.

So, I want to know what is the best way to accomplish this.

More information about the Python-list mailing list