diff --git a/package/gluon-core/check_site.lua b/package/gluon-core/check_site.lua
index 2ae05427e830fee89b9e80499d680a92b459cff9..99cdedac551b15808b2651f0a9c93ba6a03c83da 100644
--- a/package/gluon-core/check_site.lua
+++ b/package/gluon-core/check_site.lua
@@ -13,6 +13,12 @@ if this_domain() then
 		end, nil, 'be a valid domain name')
 	end
 	need_domain_name(in_site({'default_domain'}))
+
+	need_table(in_domain({'domain_names'}), function(domain)
+		need_alphanumeric_key(domain)
+		need_string(domain)
+	end)
+	need_string(in_domain({'domain_names', this_domain()}))
 end
 
 need_string_match(in_domain({'domain_seed'}), '^' .. ('%x'):rep(64) .. '$')
diff --git a/package/gluon-site/Makefile b/package/gluon-site/Makefile
index 9c24948593b73c4297b8af7811353c77f3b5cbdf..f930888c1ff08b5d3638dcdae58c3c471d4889f6 100644
--- a/package/gluon-site/Makefile
+++ b/package/gluon-site/Makefile
@@ -53,9 +53,15 @@ define Build/Compile
 	$(call GenerateJSON,site)
 
   ifdef CONFIG_GLUON_MULTIDOMAIN
+	rm -rf $(PKG_BUILD_DIR)/domains
 	mkdir -p $(PKG_BUILD_DIR)/domains
 	$(foreach domain,$(patsubst $(GLUON_SITEDIR)/domains/%.conf,%,$(wildcard $(GLUON_SITEDIR)/domains/*.conf)),
+		[ ! -e '$(PKG_BUILD_DIR)/domains/$(domain).json' ]
 		$(call GenerateJSON,domains/$(domain))
+		lua ../../scripts/domain_aliases.lua '$(PKG_BUILD_DIR)/domains/$(domain).json' | while read alias; do \
+			[ "$$$${alias}" != '$(domain)' ] || continue; \
+			ln -s '$(domain).json' $(PKG_BUILD_DIR)/domains/$$$${alias}.json || exit 1; \
+		done
 	)
   endif
 
diff --git a/scripts/domain_aliases.lua b/scripts/domain_aliases.lua
new file mode 100644
index 0000000000000000000000000000000000000000..ea7fbf3a3eb6b5f2e8727b1bf8333cc5113ae552
--- /dev/null
+++ b/scripts/domain_aliases.lua
@@ -0,0 +1,13 @@
+local cjson = require 'cjson'
+
+local function load_json(filename)
+	local f = assert(io.open(filename))
+	local json = cjson.decode(f:read('*a'))
+	f:close()
+	return json
+end
+
+local domain = load_json(arg[1])
+for k, _ in pairs(domain.domain_names) do
+	print(k)
+end