diff --git a/config.yml b/config.yml
index 27158d0..d02cf1c 100644
--- a/config.yml
+++ b/config.yml
@@ -18,6 +18,11 @@ plugins:
tld: 'cyb'
+reserved_domains:
+ # use lowercase please
+ - "opennic"
+ - "dns"
+
zonewriter:
# Values used for SOA
ns: 'ns12.opennic.glue'
diff --git a/lib/cyberman/Domains.pm b/lib/cyberman/Domains.pm
index e607a57..0901112 100644
--- a/lib/cyberman/Domains.pm
+++ b/lib/cyberman/Domains.pm
@@ -50,6 +50,14 @@ post '/domains/new' => sub {
}
}
+ if (scalar(keys(%errs)) == 0) {
+ foreach my $disallowed (@{ config->{"reserved_domains"} }) {
+ if ($name eq $disallowed) {
+ $errs{"e_reserved"} = 1;
+ }
+ }
+ }
+
if (scalar(keys(%errs)) != 0) {
return template 'domains/new' => {
%errs,
diff --git a/views/domains/new.tt b/views/domains/new.tt
index a993861..38b6048 100644
--- a/views/domains/new.tt
+++ b/views/domains/new.tt
@@ -16,6 +16,9 @@
<% IF e_chars %>
The domain '<% params.name | html_entity %>.<% vars.config.tld %>' contains invalid characters.
<% END %>
+ <% IF e_reserved %>
+ The domain '<% params.name | html_entity %>.<% vars.config.tld %>' is reserved for use by the registry.
+ <% END %>