Here's a tour through the available DNS features. You probably don't want to use any nameserver, dnsDefault, or dnsMail directives in your configuration, since dom will include the proper defaults for you. It's worth reminding that you probably shouldn't use the domain directive. We only use it here for illustrative purposes.
domain "yourdomain" with nameserver "ns1.hcoop.net"; nameserver "ns3.hcoop.net"; (* Specify two DNS servers that are authoritative for yourdomain *) dnsDefault "18.104.22.168"; (* Add a mapping from yourdomain to IP address 22.214.171.124 *) dnsIP "host" "126.96.36.199"; (* Add a mapping from host.yourdomain to IP address 188.8.131.52 *) dnsMail 23 "mail.yourdomain"; (* Register mail.yourdomain as an SMTP handler for yourdomain, with priority 23 *) dnsAlias "hcoop" "hcoop.net"; (* Add an alias such that hcoop.yourdomain resolves to the same thing as hcoop.net *) dnsIP "dynamic" "184.108.40.206" where TTL = 100 end; (* Add an IP mapping with an abnormally low time-to-live of 100, see the section about dynamic DNS below *) (* IPv6 alternatives to some of the above *) dnsIPv6 "host" "1111:2222:3333:4444:5555:6666:7777:8888"; dnsDefaultv6 "1111:2222:3333:4444:5555:6666:7777:8888"; (* Map every remaining hostname to 220.127.116.11. *) dnsWildcardIP "18.104.22.168"; end;
1. Keeping DNS elsewhere
This example shows how to configure mail handling for a domain that is primarily hosted off of HCoop. We only use domain instead of dom because dom already includes the handleMail directive that we want to demonstrate.
domain "yourdomain" where DNS = noDns with handleMail; end;