I have read over everything on setting up DNS properly for hosting your own mail server behind NAT but I just can't get it straight. So sorry if what I am missing is obvious but I can receive email. When I try to send something to my domain I get back:
<allan@wilsonss.com>: Host or domain name not found. Name service error for
name=mail.wilsonss.com type=A: Host not found
Final-Recipient: rfc822; allan@wilsonss.com
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; Host or domain name not found. Name service error
for name=mail.wilsonss.com type=A: Host not found
I want mail to be deliverable to username@wilsonss.com and outgoing mail works fine. I have setup DNS on this server and here is what I get if I check my entries with dig:
[root@mail named]# dig mx wilsonss.com
; <<>> DiG 9.2.4 <<>> mx wilsonss.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;wilsonss.com. IN MX
;; ANSWER SECTION:
wilsonss.com . 38400 IN MX 10 mail.wilsonss.com.
;; AUTHORITY SECTION:
wilsonss.com. 38400 IN NS 192.168.0.3.wilsonss.com.
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Mar 4 11:42:32 2007
;; MSG SIZE rcvd: 77
Here is what I have in named.conf(this is just the last section, there is more in the file):
[root@mail named]# more /etc/named.conf
zone "wilsonss.com" {
type master;
file "/var/named/wilsonss.com.hosts";
};
Here is what is in my wilsonss.com.hosts file:
[root@mail named]# more wilsonss.com.hosts
$ttl 38400
@ IN SOA mail.wilsonss.com. root.mail.wilsonss.com. (
2006110200
10800
3600
604800
38400 )
@ IN NS 192.168.0.3
@ IN MX 10 mail.wilsonss.com.
@ IN A 192.168.0.3
I put an entry in to my hosts file:
192.168.0.3 mail.wilsonss.com mail
And here is what I have in resolv.conf(.3 is mail server and .1 is router)
nameserver 192.168.0.3
nameserver 192.168.0.1
I am hosting the domain name with godaddy and set the mx record on their dns server to point to my routers public ip address. I know I am missing something obvious but I can't figure it out. Thanks for any help.
Allan
CentOS DNS Dummy
CentOS DNS Dummy
SO you've got an MX record for wilsonss.com (mail.wilsonss.com) but there's no A record for mail.wilsonss.com (that entry in your hosts file doesn't count)
you need to add
mail IN A 192.168.0.3
(You can test this with host -t A mail.wilsonss.com - when it comes back with an answer, you're done).
you need to add
mail IN A 192.168.0.3
(You can test this with host -t A mail.wilsonss.com - when it comes back with an answer, you're done).
CentOS DNS Dummy
That got it, thanks for the quick reply.
Allan
Allan
-
- Posts: 24
- Joined: Fri Sep 12, 2014 10:28 pm
CentOS DNS Dummy
Did you add it in your wilsonss.com.hosts file?
CentOS DNS Dummy
I added this line to wilsonss.com.hosts:
mail IN A 192.168.0.3
and this fixed it.
Allan
mail IN A 192.168.0.3
and this fixed it.
Allan
-
- Posts: 24
- Joined: Fri Sep 12, 2014 10:28 pm
CentOS DNS Dummy
that did the trick. I appreciate it, thanks.