Centos

後綴 - 找不到主機或域

  • December 23, 2015

我在我的centos 上安裝了postfix。這是postconf -n輸出:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 52428800
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relayhost = [smtp.gmail.com]:587
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = plain
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
smtpd_tls_dh1024_param_file = /etc/postfix/dhparams.pem
unknown_local_recipient_reject_code = 550

當我嘗試使用mail someone@gmail.com日誌顯示發送郵件時:

Dec 23 10:47:16 server_name postfix/smtp[20604]: *: to=<someone@gmail.com>, relay=none, delay=10, delays=0.02/0.03/10/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=smtp.gmail.com type=A: Host not found, try again)

有什麼問題?

Name service error for name=smtp.gmail.com type=A: Host not found, try again

該伺服器上的 DNS 解析出現問題。修復DNS解析,解決你的問題!

需要檢查的一些事項:

  • dig smtp.gmail.com,看看會發生什麼。
  • dig @8.8.8.8 smtp.gmail.com,看看會發生什麼。
  • 查看名稱伺服器是否存在於resolv.conf

引用自:https://serverfault.com/questions/744909