Adding DNS Records Independent of Virtual Service State

In certain cases, it may be useful to have the Avi DNS respond with a virtual service’s virtual IP address independent of the state of that virtual service. This behavior is supported starting in Avi Vantage releases 17.1.12 and 17.2.4 via state-based-dns-registration, a new option associated with the cloud object in which the VS is defined. At the time of this writing, the option is available only to users of the Avi CLI or Avi REST API.

For backward compatibility, by default, the option is TRUE for all clouds. However, if set to FALSE for a given cloud, Avi DNS lookups of virtual services within the cloud will return IP addresses as soon as the virtual services become operational. Virtual services enter the operational state when one of the following conditions are true:

  • No pool has been defined but a return page has been defined. The classic use case for this is the return of a static “under construction” page by a virtual service still in its infancy.
  • The virtual service is an Avi DNS, whether or not it has a back-end server pool defined for it.
  • A server pool has been associated with the virtual service.

How to Show/Change the state-based-dns-registration Option via the Avi CLI

Showing the Current State of the state-based-dns-registration Option

The below is an example of the output of the Avi show shell command. It has been edited to highlight the most relevant command output.


[admin:10-130-150-30]: > show cloud Default-Cloud
+----------------------------------------+--------------------------------------------+
| Field                                  | Value                                      |
+----------------------------------------+--------------------------------------------+
| uuid                                   | cloud-3e33a415-49c9-414d-b71e-8ec79289ae98 |
| name                                   | Default-Cloud                              |
|  .                                     |   .                                        |
|  .                                     |   .                                        |
|  .                                     |   .                                        |
| state_based_dns_registration           | True                                       |
| tenant_ref                             | admin                                      |
+----------------------------------------+--------------------------------------------+

Changing the state-based-dns-registration Option

The below is a sequence of Avi shell commands that configure the option to FALSE. It has been edited to highlight the most relevant command output.


[admin:10-130-150-30]: > configure cloud Default-Cloud
Updating an existing object. Currently, the object is:
+----------------------------------------+--------------------------------------------+
| Field                                  | Value                                      |
+----------------------------------------+--------------------------------------------+
| uuid                                   | cloud-3e33a415-49c9-414d-b71e-8ec79289ae98 |
| name                                   | Default-Cloud                              |
|  .                                     |   .                                        |
|  .                                     |   .                                        |
|  .                                     |   .                                        |
| state_based_dns_registration           | True                                       |
| tenant_ref                             | admin                                      |
+----------------------------------------+--------------------------------------------+
[admin:10-130-150-30]: cloud> no state_based_dns_registration
+----------------------------------------+--------------------------------------------+
| Field                                  | Value                                      |
+----------------------------------------+--------------------------------------------+
| uuid                                   | cloud-3e33a415-49c9-414d-b71e-8ec79289ae98 |
| name                                   | Default-Cloud                              |
|  .                                     |   .                                        |
|  .                                     |   .                                        |
|  .                                     |   .                                        |
| state_based_dns_registration           | False                                      |
| tenant_ref                             | admin                                      |
+----------------------------------------+--------------------------------------------+


Note: Toggling the state-based-dns-registration option impacts virtual services that are defined thereafter. It does not have a retroactive effect on virtual services that have already been defined.