There is a domain: example.gov.en
And its subdomain: subdomain.example.gov.en

When I send mail to user1@example.gov.en - it is ok, works. But when I send mail to user2@subdomain.example.gov.en - it gives error:

error while sending email: The following addresses had permanent fatal errors, reason: 550 user2@subdomain.example.gov.en recipient unknown

IP address of mail server is same for domain and subdomain.

How could I write dns record for its subdomain?

My current records for this domain are these:

example.gov.en.     IN     A
example.gov.en.     IN     MX  10   example.gov.en.
  • 1
    I wonder if this would be more appropriate over on Server Fault, since there's no UNIX components. – Jeff Schaller May 21 at 13:20

You need to add an MX (Mail eXchanger) record for the subdomain, so that other systems know how to deliver email to it:

example.gov.en.               IN     A
example.gov.en.               IN     MX  10   example.gov.en.
subdomain.example.gov.en.     IN     MX  10   example.gov.en.

Once you've got this working you should look at DMARC and SPF entries too, so as to minimise fraudulent emails claiming to come from your domains. You'll need records for these against all domains and subdomains from which you might send email.

  • 1
    Note to the OP: The new "subdomain" also does not start working automagically after setting up DNS. The MTA/mailboxes, depending on setup, need also to be told about it. I would advise thinking a little more and not doing things at random. – Rui F Ribeiro May 21 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.