Can I enter a domain name (FQDN) instead of an IP as the Backend Service address?
Short answer
Yes; on HTTP and L7 TCP vServices, a domain name can be entered in the Address field of the Backend Service and of the Backend Group rows. The domain name is resolved once when the vService configuration is loaded; if the DNS record changes, the new address is used the next time the vService is reloaded. Device DNS must be defined for resolution: for traffic, the DNS setting of the DEFAULT route table is used, and for the health check, the DNS setting of the Backend Service's route table. On a Network vService, the address is entered as an IP.
Problem: The Server's IP Is Not Fixed or It Is Managed by Name
In some environments, servers are managed by name instead of IP: the cloud or virtualization platform may change the IP, or the organization prefers to keep the server addresses in DNS. In this case, entering an IP in the Backend Service requires a manual update at every change.
Solution: Three Methods
In all three methods, the name is resolved with the same rules; first, it is checked that the name resolves from TR7, and Device DNS is defined.
| Your situation | Suitable method |
|---|---|
| I want to define a single server by name | Method 1: Backend Services form |
| I want to define the servers in a Backend Group by name | Method 2: Backend Group row |
| I want to define it from the command line | Method 3: WEB-CLI |
Method 1: Backend Services Form Recommended
- How it works The name in the Address field is resolved with the DNS servers of the DEFAULT route table when the vService configuration is loaded; the health check resolves the name again at every check with the DNS setting of the Backend Service's route table.
- Where it is openedLoad Balancer → Backend Services → Add or Edit → Address
- Requirement A Device DNS definition in the DEFAULT route table and in the Backend Service's route table
- vService type HTTP and L7 TCP
Step-by-Step Configuration
In TR7 WEB-CLI, the name is queried with sys-cmd dig and it is seen that the expected IP is returned. If the name does not resolve, Device DNS is defined with step 2; if it resolves, the procedure continues with step 3.
The Settings → General Settings → Device DNS screen is opened (how to edit). In the Route Table selector at the top left, DEFAULT is selected first and Edit is clicked. The IPs of the DNS servers are entered in the DNS Servers list with + Add; the order matters. If a single name is to be resolved to a fixed IP, an IP and Domain row is added to the Virtual Hosts table. It is saved with Edit. If the Backend Service is in a route table other than DEFAULT, the same procedure is also performed for that table: the settings are per route table, and a table other than DEFAULT does not inherit the DNS servers from DEFAULT.
Load Balancer → Backend Services → Add is clicked; for an existing record, the record is selected and Edit is clicked.
The domain name is entered in the Address field and the port in the port part (e.g. web01.example.com · 8080). The other fields are filled in as on the How is a Backend Service added; which information is required? page.
The Add (Edit when editing) button at the bottom of the form is clicked. If the Backend Service is used in a vService, the vService is reloaded with the new address.
Verification
In the preview of the vService that uses the Backend Service, it is checked whether there is a configuration warning, and in the Backend Services list, the Health indicator is checked.
No "DNS resolution error" warning · Health: OKMethod 2: Backend Group Row
- How it works The address of each row in the group's Backends table can be an IP or a domain name; each row is resolved separately.
- Where it is openedLoad Balancer → Backend Groups → Add or Edit → Backends
- Requirement A Device DNS definition in the DEFAULT route table and in the group's route table
- vService type HTTP and L7 TCP
Step-by-Step Configuration
The name is checked with sys-cmd dig as in steps 1 and 2 of Method 1; if needed, Device DNS is defined.
Load Balancer → Backend Groups → Add is clicked; for an existing group, the group is selected and Edit is clicked.
In the Backends table, the domain name is entered in the address part of the row and the port in the port part. A new row is opened with the add row at the bottom of the table.
The Add (Edit when editing) button at the bottom of the form is clicked.
Verification
In the Backend Groups list, Show Backend Services is turned on and the Health indicator of the row is checked.
Health: OKMethod 3: WEB-CLI
- How it works A domain name is entered instead of an IP address in the
addr.ipfield (--servers.N.addr.ipin a group). - Where it is opened TR7 WEB-CLI →
lb backendandlb backend-group - Requirement WEB-CLI access and a Device DNS definition
- vService type HTTP and L7 TCP
Step-by-Step Configuration
The name is queried with sys-cmd dig; if it does not resolve, Device DNS is defined with step 2 of Method 1.
The required fields are written without a prefix and in order; the domain name is entered in the addr.ip field. Host for v-device and 1 (DEFAULT route table) for namespace are the default values:
lb backend add name web-1 v-device Host namespace 1 addr.ip web01.example.com addr.port 8080In a group, the required fields are name, v-device and namespace; the servers are written in order with the --servers.N fields, starting from 0:
lb backend-group add name web-grp v-device Host namespace 1 --servers.0.addr.ip web01.example.com --servers.0.addr.port 8080 --servers.1.addr.ip web02.example.com --servers.1.addr.port 8080Verification
In the lb backend list output (lb backend-group list for a group), the address field of the record is checked.
web01.example.com and 8080 in the address fieldCommon Mistakes
- Assuming that a DNS change is reflected immediately. The name is resolved when the vService configuration is loaded; when the DNS record changes, traffic goes to the old IP until the vService is next reloaded (e.g. when the vService or the Backend Service is saved). Since the health check resolves the name again at every check, Health may appear OK in the meantime while traffic is going to the old IP.
- Entering a name that returns more than one IP. The name is resolved to a single address and traffic goes only to that address; for more than one server, each is added as a separate row or a separate Backend Service.
- Defining Device DNS only in the Backend Service's route table. For traffic, the name is resolved with the DNS servers of the DEFAULT route table; if there is no definition in DEFAULT, the name cannot be resolved, the new configuration cannot be loaded, and the "DNS resolution error" warning appears in the vService preview.
- Entering a name in the Different Address field. The Different Address field, with which the health check is performed to a different address, accepts only an IP in the panel.
- Using a name on a Network vService. The Backend Service addresses of a Network vService are entered as IPs.
How it is done in the documentation
