Thursday, March 14, 2013

dns and dhcp loops of death



 dhcp loop fun

for i in {1..2};do  index=$(($i+28-1)); echo -e "\t\thost war-vm-$i.super.mega.ultra.pony.com {\n\t\t\thardware ethernet xx:xx:xx:xx:xx:$index;\n\t\t\tfixed-address war-vm-$i.super.mega.ultra.pony.com;\n\t\t}"; done

Give you this sexy output


host war-vm-1.super.mega.ultra.pony.com {
                        hardware ethernet xx:xx:xx:xx:xx:28;
                        fixed-address war-vm-1.super.mega.ultra.pony.com;
                }
                host war-vm-2.super.mega.ultra.pony.com {
                        hardware ethernet xx:xx:xx:xx:xx:29;
                        fixed-address war-vm-2.super.mega.ultra.pony.com;
                }

dns fun

if you want to generate entry's from war-vm-1 to 60 but your ip dose not start at 1.
its time do have your dns server do some math


super.mega.ultra.pony.com

 $GENERATE       7-67    war-vm-\${-6,0} A 66.66.66.$

66.66.66

$GENERATE       7-67   $       PTR     war-vm-\${-6,0}.super.mega.ultra.pony.com.

No comments: