Build A Micro Using Google Cloud

Build A Micro Using Google Cloud

Lab 3: Build a Micro CDN Using Google Cloud
1. Create firewall rule
2. Create VMs
3. Configuring VMs
3.1. “http-1” and “http-2”
3.2. “dns-server-1”
4. Checks
Conclusion / Submission
The goal of this project is to build a micro CDN “service” using Google Cloud VMs. This would involve creating VMs, setting up a DNS server, configuring a delegated zone, updating configuration so it gives different results for requests from different clients, and setting up a simple HTTP server to serve actual content.

Go to Google Cloud Console -> VPC Network -> Firewall Rules. If missing, create a rule “allow-dns” and assign it a tag “allow-dns” so it allows from any source IP address ( to access UDP port 53 and TCP port 53.

In addition to VM from lab 2, create 2 more:

For authoritative DNS server, say “dns-server-1” (you’re free to pick your own name)Create micro-instance with Ubuntu 18.04, use us-central1-c zone.Make sure you have typed in “allow-dns” tag for the firewall. When creating, expand “Management, security, disks, networking, sole tenancy” section, go to “Networking” tab, and type in allow-dns and press enter.
Second instance of HTTP server, but use europe-west2-c zone.Make sure you have selected “Allow HTTP traffic” and “Allow HTTPS traffic”. This will automatically add proper firewall tags.
3.1. “HTTP-1” AND “HTTP-2”
Follow instructions in the lab 2.

3.2. “DNS-SERVER-1”
Note public IP address of the VM and send it to the instructor. You will be given delegation of a DNS zone.

SSH to the server and start configurations.

Update/upgrade packages and install bind9 authoritative DNS server:

sudo apt update
sudo apt upgrade
sudo apt install bind9
And now you are ready for the fun part, configuring DNS server.

With the default settings, Bind configuration is located in /etc/bind folder. Bind can work as caching resolver, authoritative resolver, or both. In our lab, we will use only the authoritative part, so we will need to delete a few files and then create a few files.

Files to delete:

Files to modify:

/etc/bind/named.conf: remove the last line that is referencing /etc/bind/named.conf.default-zones
/etc/bind/named.conf.local: This is the file where you can define zones for which your DNS server will be acting as authoritative DNS.
You can lookup the basic syntax for named.conf file online, but essentially it should contain blocks like:

zone “” {
type master; // bind has also concept of “slave” that automatically sync’s zone from master (not part of the lab)
file “/etc/bind/”;
NOTE that is just an example! and you need to use your own zone name. Same applies to below.

If we create a proper zone file, this would be enough for the domain/zone to start functioning. However, when we setting up DNS server for CDN service, this would not be enough, as we would want to return different results depending on who is asking the question. While in reality it is done with custom implementations of DNS servers, for micro CDN we could re-use features of Bind. In particular, Bind supports so called “views” that can return different zone information depending on the requester.

Ultimately, what you need to configure should look like this (make sure you use zone name that have been assigned to you by the instructor):

acl “fiu” {; // must be within FIU (estimated)

view “fiu-view” {
match-clients { fiu; };

zone “” {
type master;
file “/etc/bind/”;

view “default” {
zone “” {
type master;
file “/etc/bind/”;
Note that there is an acl block that defines one filter (feel free to pick your name for it), which is then used inside view named “fiu-view” (again, feel free to pick your name) as part of match-clients block. There is also a “default” view that is being matched to anything that was not matched before.

Compared to the basic example I showed you before, you have acl and multiple (duplicate) zone definitions, each in separate views.

To finish DNS configuration, you would need to actually create zone file, e.g., files /etc/bind/ and /etc/bind/

Both of them should look the same, with exception of a “A” record for www subdomain of your delegated zone. You can find tons of templates online, you use the following:

$TTL 3600

@ IN SOA (
2019100300 ; Serial
3600 ; Refresh
3600 ; Retry
604800 ; Expire
3600 ) ; Negative Cache TTL

ns1 IN A ; IP address of dns-server-1

www IN A ; IP address of http-1 or http2 ; each of zone files MUST contain exactly 1 resource record for `www` domain
After you are done, you can reload DNS server daemon so it picks up the changed you have made. However, before you do that, it is always a good idea to check sanity of the configuration. You can do it with this command:

sudo /usr/sbin/named-checkconf -z /etc/bind/named.conf
If everything is fine, reload DNS server daamon:

sudo rndc reload
To check if DNS properly returns what you are expecting, use dig command (or web-based dig) to see what IP address is returned.

dig A
If you are on campus, it should give you IP address of http-2, otherwise IP address of http-1.

You can do the same without dig, by just pointing your web browser to and any unique file you have uploaded to each of the instances, e.g.,

Conclusion / Submission
In Gradescope, submit

your name, ID, delegated domain name, and public IP addresses of all created VM instances
description of any problems, road blocks, what you have learned, what was interesting, not interesting, etc.
Requirements: however | .doc file

The post Build A Micro Using Google Cloud appeared first on Pro-Dissertation.

Write my Essay. Premium essay writing services is the ideal place for homework help or essay writing service. if you are looking for affordable, high quality & non-plagiarized papers, click on the button below to place your order. Provide us with the instructions and one of our writers will deliver a unique, no plagiarism, and professional paper.

Get help with your toughest assignments and get them solved by a Reliable Custom Papers Writing Company. Save time, money and get quality papers. Buying an excellent plagiarism-free paper is a piece of cake!

All our papers are written from scratch. We deliver high quality assignment answers to students.