DNS as a Service#

General information#

The Domain Name System (DNS) maps domain names to IP addresses. K2 Cloud provides DNS functionality as a service, so it is called DNS as a Service (DNSaaS).

The DNSaaS service allows you to create and administer DNS zones and resource records within them. A DNS zone performs DNS functions for a particular domain. Resource records define how to respond to a DNS request. The response content depends on the resource record type.

K2 Cloud allows you to create public and private DNS zones. Public DNS zones are designed to resolve Internet domain names. Private DNS zones allow you to use domain names instead of IP addresses within a VPC.

Attention

To delegate management of the public DNS zone for a registered domain to K2 Cloud, add K2 Cloud authoritative name servers to your registrar’s NS records. You can find the server names in the NS record that was created together with the zone. In the registrar’s NS records, specify all four values contained in the K2 Cloud’s NS record.

Note

You can try DNSaaS capabilities during a free trial period, which is valid until a special announcement.

Key concepts#

When describing DNS, many terms and abbreviations are used. Below are just the basic concepts used in K2 Cloud. For terminology details, visit the website of ICANN international registrar.

DNS zone – An independently managed segment of the DNS namespace. DNS zone is a logical space (“container”) that contains resource records. K2 Cloud supports public and private DNS zones.

Public DNS zone – Designed to resolve DNS requests from the Internet. In K2 Cloud, you can create zones to serve second- and lower-level domains.

Private DNS zone – Designed to resolve DNS requests within the VPC. You can use an arbitrary namespace in the private zone.

Record (resource record, resource record set) – Specifies where to send traffic destined for the specified domain or subdomain. Each record consists of four fields: name, type, TTL and one or more values (for details, see).

Domain name – A unique domain name used to facilitate search of resources on the Internet.

Domain name label (component, segment) – Part of a fully qualified domain name, which corresponds to a separate subdomain. For example, the domain name example.com consists of two labels example and com, which correspond to second- and first-level domains.

Name Server – A Domain Name System server that directly responds to DNS requests and stores a local copy of the DNS zone with records.

Authoritative Name Server – A name server that is responsible for serving a particular domain.

Available quotas#

For each project, the following default quotas are allocated for the DNS service:

  • Total number of DNS zones: 500.

  • Number of VPCs associated with one private zone: 1.

  • Number of records in one DNS zone: 10,000.

  • Number of values per one resource record: 400.

If necessary, you can increase quotas. To do this, contact the support service.

Resource record types#

K2 Cloud supports the following record types for public zones:

  • A

  • AAAA

  • CNAME

  • MX

  • NS

  • PTR

  • SOA

  • SRV

  • TXT

and for private zones:

  • A

  • AAAA

  • PTR

Each resource record consists of four fields: name, type, TTL, and value. The record name corresponds to the subdomain for which it is created. Depending on the record type, you can set one or more values. The record value format also depends on the selected record type. Below is a summary of supported record types with examples.

Note

A wildcard domain name cannot be used as a record name (except for CNAME records).

“А” record#

“А” record associates a domain name with an IPv4 address.

Name

Type

TTL

Values

example.com

A

3600

198.51.100.1
203.0.113.1

АAAA record#

АAAA record associates a domain name with an IPv6 address.

Name

Type

TTL

Values

example.com

AAAA

3600

2001:DB8::1
2001:DB8::FFFF

CNAME record#

CNAME record associates a domain name with another domain name. When creating it, take into account the following constraints:

  • you can specify only one value for each record;

  • you cannot create a CNAME record for the root zone;

  • you cannot create any other records with the same name (if there is a CNAME record for the name blog.example.com, then you cannot create other records for the same subdomain);

  • NS and MX records cannot point to a CNAME record (their values cannot match the names of CNAME records);

Attention

To create a wildcard CNAME record, an A or AAAA record (or another CNAME record whose name matches the value of the CNAME record you are creating) should be created in the DNS zone first.

Name

Type

TTL

Values

blog.example.com

CNAME

3600

example.com.

*.blog.example.com

CNAME

3600

example.com.

MX record#

MX record points to the mail server address for the domain. The record value consists of two parts:

  • server priority (the lower value, the higher priority);

  • mail server domain name.

Name

Type

TTL

Values

example.com

MX

3600

10 mx1.example.com
20 mx2.example.com

NS record#

NS record points to the name server responsible for serving the DNS zone. For a public zone domain, an NS record is created automatically.

Name

Type

TTL

Values

example.com

NS

3600

ns1.dnsaas.tld
ns2.dnsaas.tld
ns3.dnsaas.tld
ns4.dnsaas.tld

PTR record#

PTR record establishes an inverse relationship between an IP address and a domain name.

Important

You cannot create a PTR record for Elastic IP using DNSaaS service. If you want to configure it, then submit a request via the support portal or contact us via e-mail support@k2.cloud.

Name

Type

TTL

Values

blog.example.com

A

3600

192.0.2.1

1.2.0.192.in-addr.arpa

PTR

3600

blog.example.com

SOA record#

SOA record contains basic information about the public DNS zone. It is created together with the DNS zone and cannot be modified.

Its value consists of several parts:

  • MNAME – the domain name of the primary name server serving the zone. In K2 Cloud, this is the first name server in the NS record for the zone;

  • RNAME – the email of responsible for the zone. In K2 Cloud, this is support.k2.cloud;

  • SERIAL – the zone creation timestamp is used as a serial number;

  • REFRESH – time in seconds, after which the name server checks for updates for the zone on the primary name server;

  • RETRY – time in seconds, after which a retry is performed after a failed record update;

  • EXPIRE – time in seconds, after which the zone content ceases to be authoritative;

  • MINIMUM – minimum TTL for resource records in this zone.

Name

Type

TTL

Values

example.com

SOA

3600

ns1.c2dns.ru support.k2.cloud 2023022800 28800 7200 604800 3600

SRV record#

SRV record points to domain name and port at which a particular service is accessible on the server.

The record value consists of four parts:

  • record priority (the lower value, the higher priority);

  • relative weight for records with the same priority (the more weight, the higher preference).

  • number of the port at which the service is accessible.

  • domain name of the server where the service is running.

Record name has the following format: {service}.{protocol}.{domain_name}.

Name

Type

TTL

Values

_xmpp_client._tcp.example.com

SRV

3600

10 20 5050 my-xmpp-service.example.com

TXT record#

TXT record contains arbitrary text information about the domain. The record value must be within quotation marks.

A record longer than 255 characters should consist of space-separated strings enclosed in quotation marks. The maximum string length is 255 characters, the maximum record length is 4,000 characters.

Name

Type

TTL

Values

example.com

TXT

3600

“Text description”

txt.example.com

TXT

3600

“First string” “Second string”

Using private zones for internal domains#

DNS records are created within the VPC by default, managed by K2 Cloud, relate to the vpc-xxxxxx.internal domain, and are available within the corresponding VPC.

Warning

В домене vpc-xxxxxx.internal можно создавать частные зоны и DNS-записи, но мы не рекомендуем это делать, так как в результате изменятся ответы DNS-сервера для поддоменов vpc-xxxxxx.internal внутри VPC.

Names in the vpc-xxxxxx.internal private zone are resolved as follows:

  • User A record for the ip-xxx-xxx-xxx-xxx subdomain (the private hostname for an instance) has priority over the cloud-managed DNS record.

  • The values of the user A record for the lb-name-lb-xxxxxx subdomain (for details, see Using DNS with load balancers) are added to the balancer’s IP addresses.

For example, you have created a private zone for the vpc-xxxxxx.internal domain and the following DNS records:

ip-xxx-xxx-xxx-xxx.vpc-xxxxxx.internal IN A 198.51.100.1
lb-name-lb-xxxxxx.nlb.vpc-xxxxxx.internal IN A 203.0.113.1

Responses to DNS requests will be as follows: