Create new VitualServer+Website&EMail with ISPs DNS Servers


I wanted to ask what I should take into consideration when creating a virtual server if I want to use my domain ISPs dns servers.

Here is what I did so far:
ordered domain from foreign ISP:
DNS Servers they provide:

I changed my the Default Template of my BIND DNS Domain (System Settings>Server Templates>Default Settings>BIND DNS Domain:)

Then I created my Virtual Server with the ordered domain: www.mydomain.tld

I set up the domain on the ISPs control panel to look like this:
(The IPs listed under DNS Service are the IP of my VPS/Server)

I have waited the standart TTL of 24 Hours that my ISP gave me but my domain does not redirect to my server but rather creates an endless loop. Have I done something wrong when setting up my virtual server?

I hope I gave enough information and am thankful in advance for any tips or suggestions.


If you wish to use your own server for the DNS zone, as you set it up, you need to create NS records at your hoster instead of A records, i.e. make a zone delegation to your server.

If you create A records at your hoster, like you did, you don’t use DNS on your server at all and should turn off the BIND feature, since your hoster does the name-IP resolution for you.

Thanks for answering!

Right, I started if off completely wrong. So I deactivated BIND DNS domain and installed a new virtual server without BIND.

However, how do I “connect” the external domain DNS with my current virtual server? As far as I know virtualmin doesn’t know that there are “ &” out there but simply assumes that mydomain.tld is bound to the server.

On the other side, I don’t see an option on my ISPs control panel to bind it to my vps server other than recirecting it to an IP. Even if I direct it to connect to I’d still have to somehow link the domain to my postfix/dovecot installation.

I’ve read through at least 50 different guides about installing a virtual server today and I am utterly confused.

Virtualmin doesn’t need to know about the “” names. Your newly bought domain is configured by your hoster at the NIC to be served by “”, which in turn is being asked for A records for your domain’s hostnames.

You can see the delegation path, starting at the root servers, by doing dig yourdomain.tld +trace

All of the A and MX records you need have to be created at your hoster. This is something Virtualmin would do automatically for you if you used DNS delegation.

DNS delegation is something I hear for the first time. Am I right in assuming that would only be available if I used my own, local nameservers?

Also thanks for pointing that out. So I have to connect FROM my domain-provider TO my virtualmin and not vice-versa, yes? I was thinking completely wrong.

A last question would be, where do I see what A and MX records I need to create on my domain-providers control panel?

  1. DNS delegation means you create an NS (nameserver) record at your ISP which points your domain to your server for final hostname resolution. And yes, in that case you need to enable the BIND feature on your server.

  2. Yes, your domain provider will do the resolution of your domain name to the IP of your server for all your resource records (if you don’t use delegation).

  3. In the “DNS Service” section of the screenshot from your ISP’s control panel that you posted.

to 1: Ah yes, I think I was initially trying to do that but failing since I did not have a working nameserver on my own VPS due to a lacking 2nd IP/server.

to 3: Yes, thanks. Creating A and MX record won’t be a problem. But I think I asked my question the wrong way. What I wanted to ask is: when, for example, creating a MX record on the domain-providers controlpanel how do I know where to point it?

Right now it’s set up like this:

And I’m waiting for the 24 hour TTL to go through. But I set everything up on a whim. I have a feeling I did it wrong again. My domain will point to my IP right? But my content is in /home/user/public_html/.

I’m absolutely not asking anyone to set it up for me but could you give me an example of what I did wrong or right so I could set up the A and MX records correctly? I’m expecially confused about how to set up the MX records and what to put into the field “enter mail exchanger”. ( )

I assumed I just have to put in the name of one of the mail-users followed by the domain.

//Edit: Okay, obviously I need to put in the adress of my email-server, right? In my case postfix, since that one was installed with virtualmin if I’m not gravely mistaken… but what is the adress to it?
Really sorry for sounding like a complete newbie, I am really trying to learn but I guess I am also trying too much too soon…

//Edit 2: Okay, so I found the postfix config page on virtualmin and got overly excited for a second since it made me realize that putting my domain into “What domain to use in outbound mail” could possibly enable the server. Sadly when I try to save the config like that: // I get this error: Failed to save options : Failed to query Postfix config command to get the current value of parameter myhostname: /usr/sbin/postconf: warning: valid_hostname: numeric hostname: /usr/sbin/postconf: fatal: unable to use my own hostname

I think you’re mixing up some stuff there. :slight_smile: DNS has nothing to do with html paths on your server or with email addresses or services or port numbers. All the DNS does is resolve hostnames to IP addresses (or, in case of MX, to other hostnames).

So if someone requests “http://www.mydomain.tld/somestuff.html”, DNS resolves “www.mydomain.tld” to the right IP. Or, if someone wants to send mail to “user@mydomain.tld”, DNS is asked for the MX record for “mydomain.tld”, which points to another A record that finally resolves to the right IP. The part with html paths is done by Apache, which is contacted because the browser connects to your IP on port 80 (which Apache listens on). Conversely, email account association is done by Postfix, which is contacted because other mail servers connect to your server on port 25. DNS has nothing to do with this step.

So if your domain was mydomain.tld and your server’s IP was, you’d create a basic set of these records with the respective types at your ISP:

mydomain.tld A www.mydomain.tld A mail.mydomain.tld A mydomain.tld MX mail.mydomain.tld

You can turn on the BIND feature on your server and have Virtualmin create a zone file for your domain. Then take a look at that for a full example. (It does not hurt to turn BIND on, even if you don’t use it.)

Ah, the brain is a wonderful thing. I woke up and had figured out my postfix problem on my own. I remembered that my VPS-hoster uses a bogus Hostname on a default install so… if someone ever with my same error like above finds this thread:

  1. I changed the hostname in /etc/hosts & /var/spool/postfix/etc/hosts to one that actually resolves. Pretty boldly even used mydomain.tld since I found out this morning it already resolved into the correct IP.

  2. I changed the /etc/postfix/ config file to point to the currect hostname instead of the default, bogus one. Basically only changed those tho lines:

myhostname = bogus.bogus >>> myhostname = mydomain.tld &
mydestination = bogus.bogus >>> mydestination = mydomain.tld

Postfix is now running but I seem to still have trouble sending mail.
((/var/log/mail.log suprisingly tells me that it is still trying to connect to the bogus hostname: Jan 19 06:25:32 zenith-gaming postfix/smtp[3570]: connect to bogus.bogus[actually.the.right.ip]:25: Connection refused

As for Locutus last comment, thanks, I was really under the impression I’d need to point every request to a specific port and subfolder. :confused:
However, now that you explained it, I feel very comfortable that I did everything right this time:

//Edit: Wow, just wow how stupid was I? Of course I wrote down the wrong TLD at MX… .eu and not .com you stupid man…

Postfix might use the file /etc/mailname for its purposes, depending on config. If that doesn’t solve your Postfix issues, I’d need to know more about what you tested: From where to where did you send email, and what gets logged during the whole process?

As for your resource records: Do you expect to receive mail for “”? This is rather unusual. Or anything under If not, you only need one MX entry, for “”.

Your MX records point to “” though, which apparently does not exist.

A good website to help debug DNS issues by the way is

The only error intoDNS gives me is:
ERROR: No reverse DNS (PTR) entries. The problem MX records are: // -> no reverse (PTR) detected //
You should contact your ISP and ask him to add a PTR record for your ips //

Also about my mail.log. If you really want a full log I posted one here: ->
and commented in what I did at every major step.

Abut the intoDNS error… can/should I do something about that? Will the mail service work without a PTR record?

What I think happens is that my own server thinks the mails I send are spam/fraud mails or simply not real mails because of the missing PTR record… but can I add an own PTR record? All I can add are A, CNAME, MX, TXT,AAAA, SRV and nameserver records.

As far as I can see not even my domain provider has Reverse DNS records:

Thanks in advance.

//EDIT: about the uhm, missing SPF record I added this:

and not sure if it was coincidence or not but not 2 seconds later roundcube received a mail from my gmail account to it that I send yesterday to my @mydomain.tld adress… I guess it was right.

Also, now I can send and receive mails normally… I guess that SPF record entry helped after all

//EDIT2: Why did no one ever tell me there’s a nice “Suggested DNS Records” menu in virtualmin that tells complete squirts like me what DNS records to put in with mail providers? Oh well, I already have these set up but damn it took me long and a very helpful user to figure it out…

I feel like everything is mostly set up now… I want to say a HUGE HUGE thanks to Locutus for helping me figure most things out and walking me through everything. You’re a very patient man.

If possible, have your hoster create the PTR record for you. For email it’s best if forward and reverse lookup matches. You can’t make those records yourself, only your hoster can do that, or there might be an option for it in your customer control panel. That record isn’t strictly required, but can help with classifying mails from your server as “not spam”.

About your log errors: I can’t judge if “” is wrong/bogus or not. It looks valid to me. The warning you got says that you should not create the hostname of your server (“”) as a Virtualmin virtual server, that will lead to confusion.

Where is this “Suggested DNS Records” screen? I’ve never seen it… Then again, I always use delegation and have Virtualmin create the zone for me.

It is under Server Configuration:

And yes it only shows up if you do not use BIND it would seem as it right away states “Your Domain is not hosted by you, here are the records that will ensure that it will work properly”.

I will open a ticket and ask them to do it just to make sure. I have updated my current DNS Records and I am hoping everything will still work in 24 hours… the only thing that confuses me now is that I can’t seem to connect to my mail adress via thunderbird, it always says it can’t read my e-mail configuration and that my username or password might be wrong… but I’ll figure that out myself I recon. Other than that my server seems to be running efficiently now. Thanks again for all your help.

I have also deleted the *.mydomain.tld entries like you suggested and put in the right ones:

I have to say, it really “feels” clean and efficient now. I feel good about my A and MX records… how nerdy it that?

//Edit: I also changed my hostnames and /etc/mailname to be clean and not pointing to the virtual server in any way. That way the VPS itself is running on a fully qulified hostname now and the virtual server on virtualmin is running on it’s domain. I don’t think there is anything else I could do to make the server more efficient… I’ll start installing my website and after that it should be completely finished. All my questions are answered. This thread had served it’s purpose and is closed as far as I am concerned. :slight_smile: