Home > tech ramblings > Edit dns records using sed

Edit dns records using sed

February 5th, 2009

You can easily replace an existing IP with and new IP in a dns record using sed. Here is the way you do it.

sed -e ’s#xx.xx.xx.xx#yy.yy.yy.yy#g’ domain.com > new.domain.com

where xx.xx.xx.xx is the existing IP and yy.yy.yy.yy is the new IP

admin tech ramblings

  1. No comments yet.
  1. No trackbacks yet.