DNS

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 "69.90.123.68";
  (* Add a mapping from yourdomain to IP address 69.90.123.68 *)
  dnsIP "host" "1.2.3.4";
  (* Add a mapping from host.yourdomain to IP address 1.2.3.4 *)
  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" "5.6.7.8" 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 2.2.2.2. *)
  dnsWildcardIP "2.2.2.2";
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;