Wednesday 18 September 2013

Auto creating DNS entries in bind

So I virtualised the entire London web server infrastructure (140+ servers) and I've just come back from Santa Clara where I was sent to virtualise the infrastructure there (140+ servers).

One of the most useful things I've learned in doing these projects is that creating DNS entries can be a pain. You can obviously do this via a VIM macro (copy paste, add one to a number, repeat), but you can also do it via bind itself. It can auto generate the DNS entries for you.

For example in our db.sv1.vm.prod zone file:
$GENERATE 1-140 web${0,3,d} A 10.10.0.$
Generates the DNS entries
web001
web002
web003
...
web140
So this works for our test web servers too:

$GENERATE 1-14 testweb${0,2,d) A 10.10.7.$
generates DNS entries
testweb01
testweb02
testweb03
...
testweb14




No comments:

Post a Comment