Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an easy way to put some kind of variables into bind9 zone files?

Lets say i have a bunch of different zone-files, and i would like to define my ip's in one config file. So that i can make something like

www A $mywebserverip

I'm allready using CNAME records for this kind of things, but this is only working for subdomains, but not for the main domain's A records.

I'm more interested in some kind of script language that would generate the zone files for me and allow a single config place for ip-logic.

share|improve this question

If you keep all hostname -> IP mappings the same across zones, you can simply make all data in the zone file relative.

There are no built-in ways to script this, no.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.