Domain Aliases using bind9, exim4 and apache2
Domain Aliases
You sometimes like to create domain names that are miss-spellings or otherwise aliases. Here’s a HOWTO using bind9, exim4 and apache2
Bind
We use DNAME to specify a domain alias. Looks like NS entries are needed anyway. Don’t know yet ’bout MX, but first tests didn’t work…
Create a zone file like this, where zytolabor.ch is the alias domain
and zyto-labor.com the original domain name:
; /etc/bind/zytolabor.ch.db
@ IN SOA zytolabor.ch. shuerlimann.cyt.ch. (
2007042201 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
;
@ DNAME zyto-labor.com.@ IN NS keeper.zyto-labor.com.
@ IN NS penner.zyto-labor.com.
Add a zone declaration:
; /etc/bind/named.conf.local
zone “zytolabor.ch” {
type master;
file “/etc/bind/zytolabor.ch.db”;allow-transfer {
solnet_ns;
switch_ns;
zytolabor_ns;
};
};Restart bind and check log:
sudo /etc/init.d/bind9 restart
sudo less /var/log/daemon
Exim
Add domain to ‘dc_other_hostname’ in ‘/etc/exim4/update-exim4.conf.conf’ using ‘:’ as seperator and restart exim:
sudo /etc/init.d/exim4 restart
Apache
Assuming you’re using virtual hosts, there’s the ‘ServerAlias’ directive:
ServerAdmin ramon.egloff@cyt.ch
ServerName zyto-labor.com
ServerAlias www.zyto-labor.comServerAlias zyto-labor.ch
ServerAlias www.zyto-labor.chServerAlias zytolabor.ch
ServerAlias www.zytolabor.ch[...]
Just restart apache and start testing…
sudo /etc/init.d/apache2 restart

Leave a Reply