DNS workflow

OpenResty Edge can be used as authoritative DNS servers.

As show in the following diagram:

Without considering DNS caching, the client resolves example.com in two stages.

  1. querying the root DNS server for the authoritative server address of example.com.
  2. querying the authoritative server of example.com for the address of example.com.

If you wish to use the OpenResty Edge gateway nodes as the authoritative servers, you need to resolve the authoritative server to the gateway node.

Enable DNS

Make sure Global Configuration/DNS is enabled before using the DNS service.

Create DNS applications

Select and click on the DNS tab to create a new DNS application.

Enter the domain name to be resolved and the domain name server as instructed, e.g. example.com and ns1.example.com/ns2.example.com, respectively.

Resolve to gateway node

Go to admin console of your domain name providers. Resolve the name of domain name server (e.g. n1s.example.com above) to the gateway node.

For example, for the Godaddy users, you may go to Godaddy Admin Console and add two hostnames ns1 and ns2 first, with the IP address point the Edge gateway node IP. Then set ns1.example.com / ns2.example.com as the domain name servers.

Once the NS record take effect, the gateway node will be capable of DNS service.

Add DNS records

Choose the created DNS application in the DNS application list, and click it to add a DNS record.

The following types of DNS records are permitted: A, AAAA, CNAME, MX, TXT, and NS. Besides, the resolve can be pointed to different gateway nodes depending on the network types for users,

The currently optional network types are Country, Region and Operator.

Automatically select proper DNS records

When creating a DNS record, users may choose the network segment corresponding to that record, and Edge will return the matching DNS record via the requested IP address

or via cidr

Calculating the recommended configuration is an alternative to manually configuring each DNS record

Type in the configuration and a proper DNS record will be generated fit for that configuration

DNS Record Priorities

OpenResty Edge can be configured with different DNS resolution records for different network sources. For example, the following two DNS records are configured.

  1. DNS request from California resolves to the IP 1.1.1.1
  2. DNS request from the USA to the IP 2.2.2.2.

For such DNS records with inclusion relationships, OpenResty Edge resolves them on a precision first basis. For example

  1. if the client is from California, rule 1 will be applied and resolve to 1.1.1.1.
  2. if the client is from a non-California region of the US, rule 2 will be applied and resolve to 2.2.2.2.

Active-standby settings supported for DNS records

DNS records having totally the same type + record + network type can mutually act as active and standby records

The default setting is using the active DNS record only, but the backup DNS record will also be used in the following situations:

  1. There is no active DNS record
  2. After the health check is enabled, the active DNS record is found unhealthy

Bind DNS to k8s cluster

You can bind a DNS to a k8s cluster.

Edge will manage DNS record automatically.

Switch map to kubernetes on, select k8s cluster, click Create Button.