2

I am trying to configure my own mail server. My domain name is: example.net

I've created a subdomain (a virtual host for Apache 2): mail.example.net

My hostname is: server01 (the name of the server I get using hostname in Ubuntu's command line).

I only have one server with several virtual host: example.net (website) and mail.example.net (mail).

My record for the DNS zone file for the domain example.net should be:

mail 10800 IN A 123.123.123.123
@ 10800 IN MX 10 server01.mail.exemple.net. 

So my zone is:

@ 10800 IN A 123.123.123.123
mail 10800 IN A 123.123.123.123
server01 10800 IN A 123.123.123.123
www 10800 IN A 123.123.123.123
@ 10800 IN MX 10 server01.mail.example.net.

or:

mail 10800 IN A 123.123.123.123
@ 10800 IN MX 10 mail.example.net.

So my zone is:

@ 10800 IN A 123.123.123.123
mail 10800 IN A 123.123.123.123
server01 10800 IN A 123.123.123.123
www 10800 IN A 123.123.123.123
@ 10800 IN MX 10 mail.example.net.

1 Answer 1

1

There are two options:

  • Create an A record for example.net with IP address 123.123.123.123.
  • Create a CNAME record pointing www.example.net to example.net
  • Create a CNAME record pointing mail.example.net to example.net
  • Create a MX record pointing to mail.example.net

But since I noticed you are using the same IP addresses in your example, if you are intending to run your mail server and web server on the same machine, this becomes much simpler.

  • Create an A record for example.net with IP address 123.123.123.123.
  • Create a CNAME record pointing www.example.net to example.net
  • Create a MX record pointing to example.net
2
  • thanks for the answer. But can I use a virtual host for my mail. like mail.exemple.net? (pointing the same IP)
    – Raphael_b
    Feb 8, 2015 at 17:28
  • Absolutely. The first example and second example both assume that you are processing e-mail and web on the same server. If this is not what you intend, please let me know and I can adjust the answer to include an example where there are two separate machines doing two different things; e-mail and web. I happen to use something like example 1 but it is not necessary to create a sub-domain for this (mail.example.net). It is an option.
    – closetnoc
    Feb 8, 2015 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.