# [SOLVED] How to publicly register Mail server

## webbruno

I'm trying to host the e-mails and the site of our company into our private server. I've already followed the Gentoo Virtual Mailhosting System with Postfix Guide and my mail server is working (actually it sends mails for the local users and for external users it goes to spam) and know how to set an Apache 2 server. What I don't know (and I mean really don't) is how to make them public.

I did some research and found that I should ask my ISP to change the reverse DNS to my company domain in order to prevent my mails to be marked as spam, they are doing.

I already know I have to configure a DNS Server, it seems like my register provider already has one but I don't know how I can configure CNET, A, MX, TXT and all those tags (Is it tags the name?) and If I must do some other configuration on my server.

My Server:

Linux mail 3.2.21-gentoo #1 SMP

My /etc/hosts:

127.0.0.1 mail.zemarestaleiro.com.br mail zemarestaleiro.com.br

::1 mail.zemarestaleiro.com.br mail zemarestaleiro.com.br

My /etc/conf.d/hostname:

hostname ="mail"

What am I missing? If there's a guide about how to configure I would really be grate. Thanks in advance for the help.

Cheers

----------

## papahuhn

A public mailserver needs to be publicly announced. The current active MX record for your domain zemarestaleiro.com.br is mx.zemarestaleiro.com.br, which points to 200.234.222.116. However, the MX record has to point to your Postfix server IP (presumably 187.45.210.115 itself?). Ask your domain hoster if he can change the MX record or update the NS record for mx.zemarestaleiro.com.br.

----------

## webbruno

Yes, currently we are hosting our mail server elsewhere, so all I have to do is to change the mx to mail.zemarestaleiro.com.br and fill my ip on my register provider? Very straight forward! Thank you for the answer

----------

## papahuhn

Plus the DNS and reverse DNS thingy for mail.zemarestaleiro.com.br.

----------

## webbruno

Yes, my isp already changed my reverse DNS, the changing is going on right now as we speak (since it took from 24 to 48 hours) and my register provider already offer a DNS server so it seems I'm done right?

----------

## papahuhn

Forward DNS is even more important. Currently, mail.zemarestaleiro.com.br points to nothing.

----------

## webbruno

Forward will happen when I change mx.zemarestaleiro.com.br to mail.zemarestaleiro.com.br on my register provider right? My router is already forwarding all trafic from the ssl port to my internal mail server (running on xen)

----------

## papahuhn

It's not about packet forwarding. "mail.zemarestaleiro.com.br" needs to point to the Postfix server's IP address. So your provider needs to set an A record for mail.zemarestaleiro.com.br. This is an additional task besides the reverse DNS and MX change. And why are you mentioning SSL here?

Edit: "A record", not "NS record".

----------

## webbruno

 *Quote:*   

> So your provider needs to set an NS record for mail.zemarestaleiro.com.br

 

I knew there was something missing!   :Laughing:  So, the provider we are talking is the Register provider or my ISP or another provider? (Sorry about the confusion)

----------

## papahuhn

The provider, where you have registered the domain, yes. Please see my correction above. Or, if the nameserver is under different control, you need to change it there.

Edit: It seems that your domain's nameserver (ns1.zemarestaleiro.com.br) is your server itself. Hence, you need to configure the A record yourself.

----------

## Ant P.

You should also set up SPF for the domain if you're sending outgoing email. This makes other servers automatically reject spam with a fake address from your domain that aren't sent from your mailserver's IP:

Add a MX record pointing to the mailserver's IP, then add a TXT record containing "v=spf1 mx ~all".

----------

## webbruno

Thanks for all support I believe I'm almost there! I'll surely send an e-mail for you guys when the server is up and running (In fact I could do that now but it would end up on your spam boxes)

@Papahun

Yes, I will have to change this IP that starts with 187 to my current IP, but what about the ns1 and ns2 servers? Is there any configuration on gentoo I should change?

@Ant P.

v=spf1 mx ~all

if my mx host starts with mail should I change it to

v=spf1 mail ~all 

?

----------

## papahuhn

 *webbruno wrote:*   

> Yes, I will have to change this IP that starts with 187 to my current IP, but what about the ns1 and ns2 servers? Is there any configuration on gentoo I should change?

 

ns1 points to your server itself (187...115) , so it's in your hand to add the A record for mail.zemarestaleiro.com.br. ns2 is a different address (...104), so you have to change that somewhere else.

----------

## Ant P.

 *webbruno wrote:*   

> if my mx host starts with mail should I change it to
> 
> v=spf1 mail ~all 
> 
> ?

 

MX refers to the DNS record type, not the subdomain it's on.

----------

## wcg

This book was fairly useful in understanding the different

nameserver record types and what job they do, when you

need the different record types, etc:

http://shop.oreilly.com/product/9780596100575.do

Even if you use some other nameserver than bind

(like tinydns), knowing what record types you need when

is explained in detail in the DNS & Bind book.

----------

## webbruno

Thank you guys for all the info! As of now I have a fully functional and public mail server running smoothly Gentoo! The best linux distro with the best users!

----------

