Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When an alias have the same domain name of site (eg. www.example.com), it isn't added to DNS zone.
Comment | File | Size | Author |
---|---|---|---|
#5 | alias_dns_zone-1074966-5.patch | 1.63 KB | Thomas Bosviel |
#1 | alias_dns_zone-1074966.patch | 2.23 KB | Thomas Bosviel |
Comments
Comment #1
Thomas Bosviel CreditAttribution: Thomas Bosviel commentedThis patch add/delete CNAME records to DNS zone.
Comment #2
anarcat CreditAttribution: anarcat commentedCommitted.
However, I believe we should also add records for aliases on different zones - if they are allowed by the frontend, they should just be allowed in. Can you rework the patch for that?
Comment #3
Thomas Bosviel CreditAttribution: Thomas Bosviel commentedI'll see what I can do. We should add records for alias only if zones already exist and are managed by Aegir or we should create new zones ?
Comment #4
anarcat CreditAttribution: anarcat commentedI think we can create new zones.
Comment #5
Thomas Bosviel CreditAttribution: Thomas Bosviel commentedI tried to add records for aliases on different zones with this code :
$this->config('zone', $zone_alias)->record_set($sub_alias, array('A' => $ips));
Even if the variable
$zone_alias
reflect a different zone name, records are always added in the zone of website. I tried to disable the cache for zone config with no result. I could generate a different zone by changing the context withd(@server_master)
but this command causes many problems.My knowledge of the inner workings of Provision is too limited to be carried out this work. I publish my work here if someone wants to continue.
Comment #6
anarcat CreditAttribution: anarcat commentedtbosviel - can you review your own patch and commit it? :P we're heading towards 1.0 here... worst case, it will end up in 1.1.
For me, the patch looks good - but I haven't tested it. And there seems to be some debugging code in there, or at least that drush_log() message should be translatable (dt())...
Comment #7
Thomas Bosviel CreditAttribution: Thomas Bosviel commentedPatch reviewed and committed in development branch dev-dns_alias_records-1074966.
I have tested the patch with the install of example.com with 3 aliases : www.example.com, example.fr and www.example.fr. We should have two zone files but there is only one, example.com. You can see the files generated:
"config/dns.d/example.com.zone.inc"
"config/server_master/bind/zone.d/example.com.zone"
You can see that all aliases are stored in the same file, even if provision shows
creating example.com zone
andcreating example.fr zone
.Comment #8
Thomas Bosviel CreditAttribution: Thomas Bosviel commentedI changed the behavior of the function
config()
ofprovisionService
class to store multiple instances ofprovisionConfig_dns_zone
and manage multiple zone files.--
http://drupalcode.org/project/provision.git/commit/8834a5543f007f12f60ef...
Comment #9
anarcat CreditAttribution: anarcat commentedI am not sure I like the idea of hashing the serialized data, but I'm not familiar with the code here.
By the way, if this is merged, I believe it should be merged only in 2.x, because it looks like an API change to me (is that right?)...
http://community.aegirproject.org/discuss/2x-branch-created
Comment #10
Thomas Bosviel CreditAttribution: Thomas Bosviel commentedYes it's an API change. Even if I was careful to not break other services officially maintained, services developed by third parties may have problems in two cases.
Configuration classes are registered like this:
Before the last instance was returned, now this is the first.
Service uses the data parameter of the function
config()
several times in the same script: before the function returns the same instance, the function now returns two different instances.Comment #11
izmeez CreditAttribution: izmeez commentedsubscribing
Comment #12
anarcat CreditAttribution: anarcat commentedI wonder if this bug isn't related to #1184172: failing on "serial number overflow"?
Comment #13
ergonlogicThis will definitely need some testing at a minimum. Also, bumping version.
Comment #14
ergonlogicThis will definitely need some testing at a minimum. Also, bumping version.
Comment #15
ergonlogicThis will definitely need some testing at a minimum. Also, bumping version.
Comment #16
anarcat CreditAttribution: anarcat commentedyes
yes
yes ;)
Comment #17
ergonlogicoops, that's weird. sorry about the triple post.
Comment #24
Neograph734Moving this to the Hosting DNS module as discussed in #2466989: Spin off DNS extension.
Is this still an issue, or has this been fixed with above commits?
Comment #25
Neograph734The new system makes sure aliases are properly added.