Parameterizing Hostnames

I have read "Using Parameterizing Hostnames" and this is what i would like to use… but what to do with domain name ?

how can i avoid to write rules for sandbox, dev and production separately ? because each development place have own domain name.

this point was omitted by guide :(