2

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

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)
Keith
  • 4,627
  • 14
  • 25
wenchung
  • 21
  • 1
  • 2
  • Possible duplicate of [postfix mails (works) to all but my domain on debian](http://serverfault.com/questions/671994/postfix-mails-works-to-all-but-my-domain-on-debian) – iwaseatenbyagrue Mar 05 '17 at 14:10

1 Answers1

1

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.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • 2
    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 05 '17 at 09:22