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 = 127.0.0.0/8, 10.1.176.0/23
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
Mar 4 17:41:40 HostName postfix/smtp: 4D5232232A50: to=, 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.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.