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.
- querying the root DNS server for the authoritative server address of
example.com. - querying the authoritative server of
example.comfor the address ofexample.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.
As shown in the figure below, create a new DNS application and set up the domain name resolution server.

As shown in the figure below, add an A record to the domain name resolution server. Note that the IP address set here will be used later to modify the domain’s authoritative DNS server with your domain provider.
The IP addresses are the IP of the OpenResty Edge Node. You can choose a name from OR Gateway, the name will be resolved as the IP address of the OpenResty Edge Node automatically.

Here you can add more DNS records, such as www domain records, or @ records that resolve to the main domain.
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.
- How to configure a domain registered with GoDaddy to use a self-deployed OpenResty Edge DNS server
- How to configure a domain registered with NameSilo to use a self-deployed OpenResty Edge DNS server
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

Calculate recommended configuration
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.
- DNS request from California resolves to the IP
1.1.1.1 - 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
- if the client is from California, rule 1 will be applied and resolve to
1.1.1.1. - 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:
- There is no active DNS record
- 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.

