here is the work remaining to perform on the DNS implementation for it to be fully complete.

* support for inter-server migration. this requires placing zones in "warm-standby" by lowering the TTLs and then updating the records when migrating (which is not done at all right now) (#922258: update DNS records on inter-server migration)
* importing existing zonefiles, non-destructive edition: we need this to allow people to migrate cleanly from their non-aegir DNS and it would also be a valuable optimisation (one less file to write if we don't need the PHP storage) (#922262: parse existing zone file records AKA non-destructive zone file edition)
* rollback support: we should check generated config files syntax and rollback cleanly on errors (#922266: rollback support in DNS)

* bring back the full zonefile editor from the dead, to allow users to edit zones without going through the commandline. (#922250: DNS: generic zonefile editor)
* this implies having a real zone object in the frontend, also for proper access control (if client A has example.com, you probably don't want client B to create www.example.com, right?) (#922252: Prevent clients from hijacking each others subdomains)
* eventually, we should have a simple vs advanced zonefile editor to allow power users and regular people to edit those zonefiles. dyndns.org and gandi.net are good examples on how this can be done. (#922264: simpler zonefile editor for regular users)
* the holy grail here is full registrar support: when somebody blindly enters a non-existant domain, kindly help them register it for them and point DNS to your servers and all (#922274: integrate with registrar_api and whois)

Some of this should be implemented for 1.0, some of this is just wishful thinking at this point. Individual issues are tagged with the relevant version numbers.

Also, the DNS code is one area where unit-testing would be very useful in maintaining long term stability. It wouldn't be so hard to test either.

I am probably missing some pieces here, comments in this issue should be only regarding general progress or such missing pieces. Do not discuss the specifics of the above issues or new issues here: open new issues if necessary and just mention them in comments here. Always tag DNS issues with the dns tag.

Comments

anarcat’s picture

I had a good chat with mig5 about the frontend implementation today, and I wanted to sum up our discussions here (as I seem to be doing this speech over and over again ;).

To get the real guts moving forward with DNS in the frontend, tasks should probably look something like this, in order of dependency (e.g. #2 depends on #1:

1. import the dev_dns code in a dev-dns branch in the frontend
2. port the code to the new services API (may be a noop), especially to associate zones with *master* DNS servers
3. make sure the editor actually works (that editing and saving nodes actually operates the database)
4. create a 'zone verify' task in the frontend that will call provision-zone in the backend
5. bring the guess_zone() (and create_host) logic upwards to the frontend
6. create zone records in the frontend on site manipulations: install/verify/delete/migrate/clone (right now records are created only in the backend)

For step #4 (and others), a big design decision that needs to happen is where the reference data sits (I'm not using the word "authoritative" here to avoid confusion with authoritative/master nameservers). Right now, the reference data is in the backend. By adding DNS zone structures to the frontend, we add a third source: the database, which adds confusion and creates all sorts of synchronisation issues. So in short we end up with those 3 data sources:

1. the zonefile itself - just a cache, we can ignore it for now
2. .php files that store a copy of zone structure - the current reference data (since #3 doesn't exist yet)
3. the mysql db - potentially the new reference data

This is important to decide how data propagates between the frontend and the backend. I tend right now to go for #3 as a reference source, if only because we have DNS servers that require *no* backend at all (e.g. MyDNS, PowerDNS, etc). This means, however, that *all* the data needs to be sent on zone verification, and that it will trash existing records, or at least make it very difficult to respect manual changes to zonefiles (see #922262: parse existing zone file records AKA non-destructive zone file edition for that other discussion, a potential solution would be to send *changes* instead of the full zonefile to the backend).

#5 also requires a bit more explanations. Right now, there's logic in the backend (the "guess_zone()" function) to figure out what records to create when a given site (say www.example.com) is created (guess_zone() will tell you the zone is example.com, unless the zone www.example.com exists, which would be weird but applies in cases like example.co.uk). If the frontend will hold the reference data, it needs to make those choices itself, while the backend just obeys its choices. In other words, the frontend *knows*, and the backend *does*, which is a recurring pattern in aegir (for example with access control). "create_host" is a command to test that functionality in the backend, and it should probably go away, as #5 would move that logic to the frontend, and the backend would just create the records the frontend tells it to create. (as a side note, I think we should still keep the rr-add/rr-del commands for testing purposes, but make it clear that data would be lost when the frontend comes around, unless we figure out a better way.)

Another question that was raised is whether we want to handle DNS on all domains, regardless of the user's desires. I believe we should create domains for any site created (e.g. www.example.com should create the example.com zone), if only for access control (e.g. i own example.com now). If aegir is the authority for this zone is up to the user (through the registrar): if Aegir's DNS servers are not registered for the domain, changes will have absolutely no effect (unless there's a misconfiguration, like the server's recursive DNS servers being also authoritative, which is usually bad bad bad).

We *could* allow the user to choose whether a zone should have DNS handling, however. This would improve performance of the DNS server (since it wouldn't handle domains needlessly) and remove potentially confusing misconfigurations. It would also allow Aegir to handle non-authoritative domains. So that could be a field for the zone that would be "authority", with the value: "master", "slave", "forbid", forbid simply meaning that no DNS records are created in the backend when the zone is handled.

izmeez’s picture

subscribing, this is a great write up.

crea’s picture

Subscribing

romaingar’s picture

Subscribing

marafa’s picture

i had my first go at implementing this and while i havent even begun to play around with the aegir site, i have some observations.

1. aegir must know if named is running or not.(ie. is it installed?)
2. the current docs i found on dns in aegir does not support a chrooted bind environment. (which has broken my aegir dns implementation)

ergonlogic’s picture

Version: 6.x-0.4-alpha3 » 7.x-3.x-dev
Neograph734’s picture

Project: Hostmaster (Aegir) » Hosting DNS
Version: 7.x-3.x-dev »
Issue tags: -dns

Moving this to the Hosting DNS module as discussed in #2466989: Spin off DNS extension.

helmo’s picture

Version: » 7.x-3.x-dev

I've switched the hostmaster makefile to now use the 7.x-3.x branch. The old code was giving a few errors. #2835818: Some errors during hostmaster install

Neograph734’s picture

Oh strange, I never noticed those errors. But fair enough. The 7.x-3.x branch is currently capable of storing valid zone files. It does however not yet act on deletion of sites / aliases.

Once I have that in place I'll start dealing with the open issues and hopefully find some time to work on the front end.

There is also no upgrade path from the old DNS system (yet). Do you have an indication for a planned aegir release? I'll have some time to work on it this weekend.

Neograph734’s picture

I have committed and released the 7.x-3.x dev branch. During my latest tests it properly saved and deleted records.

I hope to be able to figure out some solution for #2841934: Provide an update mechanism for user of the old DNS system soon.