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 http://www.zyto-labor.com

ServerAlias zyto-labor.ch
ServerAlias http://www.zyto-labor.ch

ServerAlias zytolabor.ch
ServerAlias http://www.zytolabor.ch

[…]

Just restart apache and start testing…

sudo /etc/init.d/apache2 restart

Advertisements

One thought on “Domain Aliases using bind9, exim4 and apache2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s