Add domain or sub-domain to google Compute

Long before I switched to VPS, I was a rookie thinking that C panel is the only thing in the whole world capable of doing what I want and need from a hosting environment.
Yes, I was wrong. 80% of its capabilities I never, never ever used. It’s literally just for playing and introducing yourself to the hosting environment, which is great and necessary in the very beginning.

Lets get right to the core:
To add a domain to you VM instance (and website), go to
Network Services > Cloud DNS

2. ..then click on +Create Zone
You will be asked to fill 3 fields.

In the Zone name Just type something like ” mysites domain zone”
DNS name is your domain:
Click “Create”.

Then, add an A record to point your domain to your server’s IP, and
add a CNAME record to point your to

To add any sub-domains, just add an A record, write your sub-domain name and point it to your server’s IP.

Do not forget to reserve your domain/server IP, to make it static. The thing is that Google holds the right to change your server’s IP if the system finds it necessary, which probably ain’t gonna happen, but to be sure it is better to reserve the IP.

To do that you have to navigate to VPC network > External IP addresses. From there change (under ‘Type‘) Ephemeral to Static. That’s it.


More from author


  1. Hi Thanks for the article.

    I did the same thing and able to access my website.I created a sub domain via A record and pointed to same reserved static IP. and also created another virtual directory in IIS.
    But when I browse sub domain it is not pointing to my sub domain virtual directory instead opening default website.

    could you please let me know how to point my sub domain to sub domain virtual directory

    • Hi,
      I would be glad to help you of course, but you need to give me little bit more details.
      I need to know are you using anything like Serverpilot or similar? Is it a wordpress app? is it on nginx or LAMP..? etc

  2. I created a sub domain via A record and pointed to same reserved static IP. But my subdomain is redirect on my domain. I need your help.

    • I don’t know unless you share more info, like: are you running WordPress (how did you install it) and the rest of your DNS zone configuration.

  3. Thank you. I have a question, Adding the A record and pointing to my server static IP. will it actually go to SUB.MyStaticIP ?
    Because I have nginx server setup and configured to handle the subdomain when requested but I’m not sure will the browser respond to SUB.MyDomainName with SUB.MyStaticIP or just MyStaticIP

    • Every time you call your server ip in the browser, your server will respond with the default (main) website.
      There are no sub.staticIP calls – impossible. For example: you cant have “ninja.”, you can only have
      You need nginx to resolve the subdomain or domain requests. Google DNS creates and points your subdomain to your server, and then the server must be able to tell the difference between subdomain or domain requests.

      If you simply want to use nginx, it is best to let it be handled by one of the best in class control panels.
      You should try Vesta CP, or maybe ISP Config, or similar.

      Managing nginx on your own is hard and time consuming even for professionals.


Please enter your comment!
Please enter your name here

Related posts

Latest posts

Winamp is the best music player for Windows PC

Winamp, it really whips the llama's ass! 🙂 The best music player of all time.Old school people should know why. My first music player is...

Preload, DNS Prefetch, Preconnect

Find out what does Preload, DNS Prefetch an Preconnect functions are, how they differ from each other and where to use them.

All in One SEO Pack Pro vs Yoast SEO Pro

The ultimate comparison: All in One SEO pack Pro vs Yoast SEO Pro. Find out which one is the best in the year 2020.