DNS Default MX Records

Hi,

I noticed that when a new virtual server is created these entries are made.

MX 5 mail.${DOM}.

mail.${DOM}. IN A IP

Above is just an example. My server actually uses custom mail servers, and there is no where to edit these directives. I can't use the option "Use only the records above" because each of my websites are assigned their own IP address and would have to make manual edits like I am now for the mail server.

I noticed this line in feature-dns.pl

&bind8::create_record($file, "mail.$withdot", undef,
                      "IN", "A", $ip);
&bind8::create_record($file, $withdot, undef,
                      "IN", "MX", "5 mail.$withdot");

If i could just define a custom IP for the mail server it would solve my problem. Let me know.

Status: 
Closed (fixed)

Comments

So do your domains have their mail hosted elsewhere? If so, you should turn off the "Accept mail for domain?" feature on the creation form - in this case, no mail or MX records will be created.

Well this server actually is my mail server and DNS server. So I use an external IP when I create it (an IP of another server where the web files are stored). But that IP is being set for the mail server.

Ok, so what you really want is for the www record to point to a different system, but the mail record to point to your Virtualmin system?

Ok, in that case you should go to System Settings -> Server Templates -> Default Settings -> BIND DNS Domain, and in the "Address records for new domains" field un-check www.domain and "Domain name".

Then in the "BIND DNS records for new domains" field enter :

www.${DOM}.  IN  A  1.2.3.4
${DOM}.  IN  A  1.2.3.4

Replacing 1.2.3.4 with the IP of your webserver.

When you create a domain, just use the default IP, which is the IP of your virtualmin system. This will be used in the mail record.

I would do this but each of my websites are assigned to their own IP address. That would limit be to use the same IP for each website.

Are these all IPs on external systems

One fix may be to not add any records in the template, and then simply add the www record after the domain has been created.

What I am doing now is I just added another mail subdomain, and I delete the old one after I create the virtual server.

Just wanted to make sure there wasn't anything I was missing.

If I comment out this line: &bind8::create_record($file, "mail.$withdot", undef, "IN", "A", $ip);

Then all my problems are solved, but I will not do that for sake of updates.

Automatically closed -- issue fixed for 2 weeks with no activity.