In this part you'll define DNS records on a
dedicated nameserver ns1.hdm-stuttgart.cloud. This one being
connected to the global DNS system allows for
publishing your records worldwide.
-
Dedicated course related DNS server
ns1.hdm-stuttgart.cloud. -
One subdomain per group e.g. g3.sdi.hdm-stuttgart.cloud corresponding to Group 3.
-
Zone edits require a subdomain specific
hmacsecret key being provided asdnsupdate.secfile in your personal group entry below the SDI course:hmac-sha512:g3.key:I5sDDS3L1BU...
Note
The per zone secrets have been created using tsig-keygen.
-
Edits become globally visible. Mind the TTL setting: A higher value means you'll have to wait longer until updates become visible.
Key file available in your working group below 113475 Software defined Infrastructure.
$ export HMAC=hmac-sha512:g3.key:YXWSeh3l... $ dig @ns1.hdm-stuttgart.cloud -y $HMAC -t AXFR g3.sdi.hdm-stuttgart.cloud ... g3.sdi.hdm-stuttgart.cloud. 600 IN SOA ns1.hdm-stuttgart.cloud. ... g3.sdi.hdm-stuttgart.cloud. 600 IN NS ns1.hdm-stuttgart.cloud. g3.sdi.hdm-stuttgart.cloud. 600 IN SOA ns1.hdm-stuttgart.cloud. ... g3.key. 0 ANY TSIG hmac-sha512. 1746433052 300 64 bak... ...
See AXFR for details.
export HMAC=hmac-sha512:g3.key:YXWSeh3l... $ nsupdate -y $HMAC > server ns1.hdm-stuttgart.cloud > update add www.g3.sdi.hdm-stuttgart.cloud 10 A 141.62.75.114 > send > quit $ dig +noall +answer @ns1.hdm-stuttgart.cloud www.g3.sdi.hdm-stuttgart.cloud www.g3.sdi.hdm-stuttgart.cloud. 9 IN A 141.62.75.114 $ dig +noall +answer @8.8.8.8 www.g3.sdi.hdm-stuttgart.cloud www.g3.sdi.hdm-stuttgart.cloud. 3 IN A 141.62.75.114
$ nsupdate -y $HMAC
> server ns1.hdm-stuttgart.cloud
> update delete www.g3.sdi.hdm-stuttgart.cloud. 10 IN A 141.62.75.114
> send
> quit
>
$ dig +noall +answer @8.8.8.8 www.g3.sdi.hdm-stuttgart.cloud
$ Note
Examples at DNS Updates with nsupdate
No. 21
Enhancing your web server.
|
Q: |
Enhance your web server from Improve your server's security! by:
|
-
Providing DNS info for sdi.hdm-stuttgart.cloud and sub-zones:
-
g1.sdi.hdm-stuttgart.cloud
-
g2.sdi.hdm-stuttgart.cloud
-
...
-
-
Remote API for per-zone editing
provider "dns" {
update {
server = "ns1.hdm-stuttgart.cloud"
key_name = "g12.key." # Corresponding to your group e.g., Group 12
key_algorithm = "hmac-sha512"
key_secret = var.dns_secret
}
}This requires:
-
A corresponding
variable "dns_secret" {...}declaration. -
An e.g.,
export TF_VAR_dns_secret = "sVfw2a...vAUqw=="(non - versioned!) environment variable.
resource "dns_a_record_set" "helloRecord" { zone = "${var.dnsSubnetName}." # The dot matters! name = hcloud_server.helloServer.name addresses = [hcloud_server.helloServer.ipv4_address] ttl = 10 }
Likewise with dns_cname_record and other record types.
No. 22
Creating DNS records
|
Q: |
In this exercise we start from a domain gxy.sdi.hdm-stuttgart.cloud not yet containing any »A« or »CNAME« records. The aim is using Terraform to create:
Provide proper variables representing:
This way your Terraform configuration remains flexible. You may follow the subsequent steps each time testing your result: dig +noall +answer @ns1.hdm-stuttgart.cloud -y $HMAC -t AXFR gxy.sdi.hdm-stuttgart.cloud
|
No. 23
Creating a host with corresponding DNS entries
|
Q: |
Extend Solving the Use the server's common DNS name
rather than its IP in the generated
|
No. 24
Creating a fixed number of servers
|
Q: |
Write a Terraform configuration
for deploying a configurable number of servers being defined by
the following terraform
|
