cdkinfracode/dns_setup_instructions.md

2.7 KiB

Hostinger DNS Setup Instructions for Mailcow

Follow these steps one by one to configure your DNS records in Hostinger for your mail server.


Step 1: Add the Subdomain (A Record)

This points your mail subdomain to your EC2 instance's Elastic IP address.

  1. Go to your Hostinger Control Panel > DNS Zone Editor.
  2. Create a new record with the following details:
    • Type: A
    • Name (Host): mail
    • Points to (IP Address): 13.205.93.190
    • TTL: 14400 (or default)
  3. Click Add Record.

Step 2: Route Emails (MX Record)

This specifies that incoming emails sent to @yourdomain.com should be routed to Mailcow.

  1. Check your existing DNS records in Hostinger and delete any default/old MX records first.
  2. Add a new record:
    • Type: MX
    • Name (Host): @
    • Points to (Mail Server): mail.yourdomain.com (Replace "yourdomain.com" with your actual domain, e.g., "tiproemail.com")
    • Priority: 10
    • TTL: 14400 (or default)
  3. Click Add Record.

Step 3: Authorize EC2 to Send Mail (SPF Record)

This tells receiving mail servers that your EC2 instance IP is allowed to send emails on your behalf.

  1. Add a new record:
    • Type: TXT
    • Name (Host): @
    • TXT Value: v=spf1 ip4:13.205.93.190 -all
    • TTL: 14400 (or default)
  2. Click Add Record.

Step 4: Setup DMARC Policy (Protection against spoofing)

This policy dictates how receiving servers should handle emails that fail SPF/DKIM checks.

  1. Add a new record:
    • Type: TXT
    • Name (Host): _dmarc
    • TXT Value: v=DMARC1; p=quarantine; pct=100; adkim=r; aspf=r
    • TTL: 14400 (or default)
  2. Click Add Record.

Step 5: Setup DKIM Record (DomainKeys Identified Mail)

This adds a digital signature to outgoing emails to verify they were sent by you.

  1. Deploy your EC2 instance and wait for Mailcow to start up.
  2. Log into the Mailcow web interface at: https://mail.yourdomain.com (Default login: Username: admin / Password: moohooChange this password immediately!).
  3. Navigate to Configuration > ARC/DKIM.
  4. In the "Domain" field, enter your domain name (e.g. yourdomain.com).
  5. Choose a selector (default is dkim).
  6. Click Add (or Generate). Mailcow will display a long public key string.
  7. Go back to your Hostinger DNS Zone Editor and add a new record:
    • Type: TXT
    • Name (Host): dkim._domainkey (If you used a different selector than 'dkim', replace the prefix with 'selector._domainkey')
    • TXT Value: (Paste the entire public key string provided by Mailcow)
    • TTL: 14400 (or default)
  8. Click Add Record.