How to create a DNS¶
You can create a Domain Name Service so that users can access your compute via the domain name instead of a floating or private IP address.
1. How to create a public DNS¶
Connect a Compute to the Public network.
Click on the network port and set the dns_name.
Input the Domain and Subdomain field (e.g.,
myexample.com
andwww
, respectively)
Important
The domain must be globally unique in the Domain Name Service of Open Telekom Cloud.
Note
Blank subdomain: Traffic will be routed to the domain
myexample.com
.Subdomain "www": Traffic will be routed to
www.myexample.com
, which is usually used for a website.Subdomain "*": Traffic will be routed to any subdomain of the domain.
Expect result¶
One DNS public zone
myexample.com.
with one record set type Awww.myexample.com.
pointing to the floating IP of the public compute (e.g.,80.158.91.193
).
Test¶
Update your domain name at the registration service to the nameservers of Open Telekom Cloud:
ns1.open-telekom-cloud.com
andns2.open-telekom-cloud.com
. Or to test on localhost, update the nameservers of your localhost to the nameservers of Open Telekom Cloud.Test your domain is resolved to the floating IP:
$ dig www.myexample.com
;; QUESTION SECTION:
;www.myexample.com. IN A
;; ANSWER SECTION:
www.myexample.com. 300 IN A 80.158.91.193
Note
The DNS zone takes effect only after you update the nameservers of your domain at the domain registrar to:
ns1.open-telekom-cloud.com
andns2.open-telekom-cloud.com
Important
Swiss Open Telekom Cloud does not support DNS public zone, but only DNS private zone. When you set a dns_name to a network port, a DNS private zone will be created instead.
2. How to create a private DNS¶
Put the compute in a private network (i.e., the network port does not connect to a public network)
Click on the network port and set the dns_name (same as above).
Expect result¶
One DNS private zone
myexample.com.
with one record set type Awww.myexample.com.
pointing to the private IP address of the network port (e.g.,10.0.0.147
)