First time setup Nagios 4 on Centos 7 with Postfix for sending alert emails. My local domain is example_1.com my exchange mailbox mx record is example_2.com, and both behind firewall on the same network.

When sending email through Postfix from nagios@example1.com to user@example_2.com, I keep getting

Name service error for name=example_2.com type=A: Host found but no data record of requested type.

I suspect it is DNS misconfiguration in Postfix. How do I resolve this issue? Please advice. Much appreciated.

Please see below for my /postfix/main.cf

myhostname = HostName.example_1.com
mydomain = example_1.com 
myorigin = $mydomain
inet_interfaces = all
inet_protocals = ipv4
mydestination = $myhostname, localhost.$mydomain,localhost, $mydomain
mynetworks =,
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination, permit_sasl_authenticated,reject

Error message:

Mar 4 17:41:40 HostName postfix/smtp[13576]: 4D5232232A50: to=<user@example_2.com>, relay=none, delay=0.03, delays=0.02/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found.  Name service error for name=example_2.com type=A: Host found but no data record of requested type)

Your domain doesn't have an MX record to specify where mail should be delivered. When this happens, the address record (AAAA or A) will be tried instead, but your domain name doesn't have those either.

Or, the domain has an MX record but the host named in the MX record label does not have address records.

To resolve the problem, create an appropriate MX record.

  • Thank you Sir, The Postfix alert mails only needs to be sent to the Exchange within the same LAN. Could you please clarify the appropriate MX record you advised should be created in DNS server or is it defined somewhere within Postfix? – wenchung Mar 5 '17 at 9:22

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.