Using Virtualmin together with google domain DNS for two website under the same main domain

SYSTEM INFORMATION
OS type and version Ubuntu 18.04
Virtualmin version 7.3

First, apologize if this is an easy-to-resolve question, but I’ve searched and read for a while on the forum and am still a bit confused about my problem below:

Background:
I have a website hosted by github under xxx.github.io, and a domain my-google-domain.com registered using google domain and linked to my github website. So people accessing my-google-domain.com will actually be directed to my github website.

I used google DNS by default.

Status Quo:
I recently bought a VPS and would like to serve a blog on it. Virtualmin comes with my VPS so I think it is natural to use it.

But creating Virtualmin always requires a domain field to be filled, which I don’t need. I just need an IP address that can be accessible and link that in my Google Domain settings.

Problem:

  1. How can I host my original website at github using my-google-domain.com (www.my-google-domain.com also should work), and host my blog website at my VPS using blog.my-google-domain.com? – primary and secondary domain hosted on different places?

Additional Question

  1. It seems virtualmin requires a fill a domain when creating a virtual server. Can I just create one server without, and link the ip_address:port to my secondary domain in google domain’s setting area?
  2. I understand I can use my VPS as my DNS, is it worse compared to using google DNS?

@xarthur,

The domain itself is used for more than DNS within Virtualmin, it’s used to Apache (web server), and most other services.

You can disable DNS locally if you are using Google’s DNS, but you still need to punch in the domain name for the Apache at the least.

Use blog.my-google-domain.ltd here. If this is the only virtual server on your Virtualmin system then it will also be accessible via the IP address of your Virtualmin system.

In Google’s control panel, create an A record for blog.my-google-domain.ltd and point it to the IP address of your Virtualmin system. Keep all other DNS records as they are currently. In this way, your domain and www subdomain will continue to point at GitHub but the blog subdomain will point to the Virtualmin system.

Many of us here use only Virtualmin’s DNS and it makes things really easy for us. Based on the questions you have asked, I feel there is some learning required for you to do before you are ready to configure Virtualmin to use its DNS to host your blog on Virtualmin and your website on GitHub. Learn about DNS. Search these forums. It has all the answers that you seek.

You asked if Virtualmin DNS is worse compared to Google DNS. I don’t know how to answer that question. If you seek breadth of features then Google is better but if you seek ease and simplicity of administering your server then Virtualmin’s DNS is managed automatically in the background by operations that you perform on the Virtualmin GUI. You will probably never have to manage DNS records once you set up Virtualmin correctly.

I, for example, point the nameservers of a new domain which I wish to host on my Virtualmin system to dns1.indiax.com and dns2.indiax.com (these are Virtualmin’s nameservers on my system) and then never bother about DNS records for the new domain, because from then on Virtualmin manages it all.

When I use Virtualmin’s GUI to create a virtual server for the new domain, the DNS records are created automatically by Virtualmin. I want a subdomain? I use Virtualmin’s GUI and the DNS records for the subdomain are created automatically. DKIM, SPF etc.? Of course Virtualmin creates these records automatically. I never have to create them, configure them or copy them over to Google’s control panel because I use Virtualmin’s DNS. But I did have to understand how DNS works and I did get my glue records set up and I followed instructions to get Virtualmin set up correctly for all this to happen so easily and automatically now.

For those who do not use Virtualmin’s DNS, they have to manually copy over DNS records to the third party DNS service that they use, like you do Google, and this is a one time operation but it must be done.

Virtualmin manages name-based virtual hosts. Of course it requires a name.

Thank you all for the answer, especially @calport 's detailed explanation!

I’ll look deep into this topic and learn what I should.

Thank you for the detailed explanation.
I’ve researched a bit more and come up with a new related question here:

The answer to this question should resolve my confusion about the comparison between using Google or Virtualmin as DNS for reachability issues –

Will using Virtualmin reduce the reachability of my website from around the world (For instance, countries with cencorship system like China or Iran)?

On another note, Ubuntu 18.03 will be end of life this coming April, so you’ll need to look at upgrading soon.

And what if I want to have other sub-domains like work.my-google-domain.ltd, life.my-google-domain.ltd? If I manage them in Google Domain’s control panel, should I fill the same IP address to my VPS? How will Virtualmin manage the exposure of different virtual server created?

No, that is not really necessary, as Vitualmin’s DNS is not authoritative for your domain; it is Google’s DNS which is authoritative for your domain.

Virtualmin’s DNS has no role to play in the subdomains that you create since everyone in the world will be referring to Google’s DNS for information about your domain’s DNS records; it is Google’s DNS which is authoritative for your domain.

No! For basic domain name resolution, Virtualmin’s DNS is as good as any other and using it will not reduce the reachability of your website.

I don’t know much about China and their censorship but in those places where the internet works as it is supposed to, Virtualmin’s DNS is as standards compliant as any other and works just as well as any other.

1 Like

Yes, I understand I need to manage the DNS and A records in Google Domain.
My question is actually how using different sub-domains pointing to my VPS’s IP address result in different website.

When I create multiple servers from Virtualmin, the default setting is using the same IP address.
But how does “setting these sub-domains A record in Google’s CPanel pointing to my VPS’s IP address” result the effect of I can use these sub-domains to access different website?

I found many institute have different departments’ website in the format like:

dep1.inst.edu
dep2.inst.edu
dep3.inst.edu

and using dig to check those subdomain, I found that all these sub-domains are actually a CNAME of a domain

xxx.inst.edu

which is a A name of a IP address. So something must happened here… and I cannot find out what and how

OK… I found out the answer to this issue is the “virtual host”.
I somehow mixed the concepts about “virtual server” and “virtual host”.