LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-17-2014, 11:48 PM   #1
rrangel11
LQ Newbie
 
Registered: Aug 2014
Posts: 2

Rep: Reputation: Disabled
postfix appears not finding MX records or host names from DNS


I am working on a test environment using a postfix server as an email gateway using the transport_maps parameter. The /etc/postfix/transport file looks like.

lornadell.com relay:[mail2.lornadell.com]

This configuration above works, but if mail2.lornadell.com goes down I would then want the email to go to mail.lornadell.com. What I understand from searching around you can't have two entries like this in the transport file.

lornadell.com relay:[mail2.lornadell.com]
lornadell.com relay:[mail.lornadell.com]

and is recommended to use MX records for this so that mail.lornadell.com would be secondary. In the above examples the brackets disables MX lookups so to get MX lookups working I modified the parameter to look like.

lornadell.com relay:lornadell.com

Right now I am sending an email message from the relay server itself but I also get the same results when sending messages from outside the network.

---------
Here is the error message from the logs

Aug 18 04:26:29 relay postfix/pickup[5294]: 592FD21E02: uid=0 from=<root>
Aug 18 04:26:29 relay postfix/cleanup[5299]: 592FD21E02: message-id=<20140818042629.592FD21E02@relay>
Aug 18 04:26:29 relay postfix/qmgr[5295]: 592FD21E02: from=<root@relay.localdomain>, size=419, nrcpt=1 (queue active)
Aug 18 04:26:29 relay postfix/smtp[5301]: warning: no MX host for lornadell.com has a valid address record
Aug 18 04:26:29 relay postfix/smtp[5301]: 592FD21E02: to=<rrangel@lornadell.com>, relay=none, delay=0.08, delays=0.06/0.02/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=mai12.lornadell.com type=A: Host not found)


---------
Here is the DNS zone configuration

$TTL 21600
@ IN SOA pepperrun.home.com. rrangel.lornadell.com. (
2014081000
10800
3600
604800
10800 )

IN NS pepperrun.home.com.

localhost IN A 127.0.0.1
relay IN A 192.168.1.71
mail IN A 192.168.1.72
mail2 IN A 192.168.1.73

lornadell.com. IN MX 10 mai12.lornadell.com.

---------
On the relay server here is what the DNS lookup shows

[root@relay postfix]# dig MX lornadell.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> MX lornadell.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29417
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;lornadell.com. IN MX

;; ANSWER SECTION:
lornadell.com. 21600 IN MX 10 mai12.lornadell.com.

;; AUTHORITY SECTION:
lornadell.com. 21600 IN NS pepperrun.home.com.

;; ADDITIONAL SECTION:
pepperrun.home.com. 21600 IN A 192.168.1.30

;; Query time: 48 msec
;; SERVER: 192.168.1.30#53(192.168.1.30)
;; WHEN: Mon Aug 18 04:36:39 2014
;; MSG SIZE rcvd: 98

--- and ---

root@relay postfix]# dig mail2.lornadell.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> mail2.lornadell.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17245
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;mail2.lornadell.com. IN A

;; ANSWER SECTION:
mail2.lornadell.com. 21600 IN A 192.168.1.73

;; AUTHORITY SECTION:
lornadell.com. 21600 IN NS pepperrun.home.com.

;; ADDITIONAL SECTION:
pepperrun.home.com. 21600 IN A 192.168.1.30

;; Query time: 4 msec
;; SERVER: 192.168.1.30#53(192.168.1.30)
;; WHEN: Mon Aug 18 04:37:58 2014
;; MSG SIZE rcvd: 98

---------
And here is what the postfix config looks like

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 = 192.168.1.71, localhost
inet_protocols = ipv4
local_recipient_maps =
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
masquerade_domains = lornadell.com
mydestination =
myhostname = relay
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relay_domains = lornadell.com
relayhost = smtp-server.austin.rr.com
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_host_lookup = dns
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
 
Old 08-18-2014, 01:55 AM   #2
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Kubuntu,Free BSD,OSX,Windows
Posts: 342

Rep: Reputation: 59
Put all of your known hosts in the /etc/hosts file on each relevant server, and make sure that

Quote:
hostname -f
returns the right FQDN,

and I'll bet your problems go away...

 
Old 08-18-2014, 07:49 AM   #3
Plastic Freddie
LQ Newbie
 
Registered: Jan 2007
Location: Shrewsbury, UK.
Distribution: Ubuntu - for an easy life. Originally used heavily-customised Arch. Also dabbled in SLES.
Posts: 6

Rep: Reputation: 1
Typo in hostnames in zone file

Quote:
mail2 IN A 192.168.1.73

lornadell.com. IN MX 10 mai12.lornadell.com.
mail2 in the "A" record
mai12 in the "MX" record

Look closely and you'll see what I mean. "A" record is correct, I believe.
 
1 members found this post helpful.
Old 08-18-2014, 09:58 AM   #4
rrangel11
LQ Newbie
 
Registered: Aug 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Looks like Plastic Freddie's eagle eye was the answer. Being new to Postfix I was all tied up thinking there was at least one more parameter that needed setting and not really paying attention to what all my DNS testing output was showing me.

Also thanks to ceyx comment since lot of my test environments I use the short name for the hosts.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dns: request all host records? stateless Linux - Networking 2 01-08-2014 02:25 AM
Postfix not sending mail - Host MX records not found? kayasaman Linux - Server 8 01-20-2012 11:47 AM
Internal host names resolving through external DNS?!? dschuett Linux - Networking 2 02-06-2011 03:14 PM
2005le - Postfix and Host Names High-gain Linux - Newbie 2 07-31-2006 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration