Routing by DNS appending

From Halon, SMTP software for hosting providers
Jump to: navigation, search

As an alternative to scripted routing, you can use a DNS server for routing. This guide describes how to create custom zones in BIND.

Simply configure the transport for the "any" domain with

lookup-mx:zone=customer.example.com;query=ns1.example.com,ns2.example.com

as destination, and configure your DNS server(s) according to the example below. You should change the IP (1.1.1.1) to match your Halon system's address (as the name server sees it), and of course all hostnames and IP addresses (to match your configuration).

/etc/named/named.conf

options { directory "/etc/namedb"; }
zone "halonsecurity.com.customer.example.org" {
        allow-query { 1.1.1.1; };
        type master;
        file "halonsecurity.com.customer.example.org.zone";
};

/etc/named/halonsecurity.com.customer.example.org.zone

$ORIGIN halonsecurity.com.customer.example.org.
$TTL    86400
@       IN      SOA     ns1.example.org. info.example.org. (
                        2009012101       ; serial number YYMMDDNN
                        28800            ; Refresh
                        7200             ; Retry
                        864000           ; Expire
                        86400            ; Min TTL
			)

	IN	NS	                 ns1.example.org.
	IN	MX	10               mx
mx	IN	A	                 1.2.3.4