diff --git a/dns/dns.drush.inc b/dns/dns.drush.inc index 6b600342f1685bdc6959fb8d6040482deb5f48ee..b396ac4538742d6494e62fd49b9d0e13e2399608 100644 --- a/dns/dns.drush.inc +++ b/dns/dns.drush.inc @@ -322,6 +322,7 @@ class provisionService_dns extends provisionService { $host = $this->context->uri; $zone = $this->context->dns_zone; $sub = $this->context->dns_zone_subdomain; + $aliases = $this->context->aliases; } else { return drush_set_error('DRUSH_DNS_NO_ZONE', "Could not determine the zone to create"); @@ -340,6 +341,12 @@ class provisionService_dns extends provisionService { } $this->config('zone', $zone)->record_set($sub, array('A' => $ips)); + foreach ($aliases as $alias) { + if ($this->guess_zone($alias) == $zone) { + $this->config('zone', $zone)->record_set($this->guess_zone($alias, 'subdomain'), + array('CNAME' => array($zone . '.'))); + } + } $this->create_zone($zone); $this->create_config('host'); @@ -363,14 +370,21 @@ class provisionService_dns extends provisionService { $host = $this->context->uri; $zone = $this->context->dns_zone; $sub = $this->context->dns_zone_subdomain; + $aliases = $this->context->aliases; } else { return drush_set_error('DRUSH_DNS_NO_ZONE', "Could not determine the zone to create"); } // remove the records from the zone store - $this->config('zone', $zone)-> - record_set($sub, array('A' => null))->write(); + $this->config('zone', $zone)->record_set($sub, array('A' => NULL)); + foreach ($aliases as $alias) { + if ($this->guess_zone($alias) == $zone) { + $this->config('zone', $zone)->record_set($this->guess_zone($alias, 'subdomain'), + array('CNAME' => NULL)); + } + } + $this->config('zone', $zone)->write(); } }