I am trying to create a auto install script since I have to do this installation task on multiple servers.
I have setup all the bind9 configuration files with my variables and thought it would have worked if the variables were set, however when the bind service starts, it errors out stating the variables aren't recognized.
For example of one of the errors showing up in /var/log/syslog:
dns_rdata_fromtext: /etc/bind/db.override:16: near ''$IP'': bad dotted quad
my configuration file:
;The Variables here are NIC and IP
; BIND data file for overridden IPs
;
$TTL 86400
@ IN SOA ns1 root (
2012100401 ; serial
604800 ; refresh 1w
86400 ; retry 1d
2419200 ; expiry 4w
86400 ; minimum TTL 1d
)
; need atleast a nameserver
IN NS ns1
; specify nameserver IP address
ns1 IN A $IP ; external IP from $NIC
; provide IP address for domain itself
@ IN A $IP ; external IP from $NIC
; resolve everything with the same IP address as ns1
* IN A $IP ; external IP from $NIC
I have searched around the net and can't quite find a solution that reflects what I'm trying to do here. I'm not a shell scripting pro and have noticed bind and another program I am implementing variables into both can't seem to process variables when they're included in config files like I have done above.
$IPgetting set?