Skip to content

Reset custom DNS Servers on vNet back to default (Azure-provided) #16699

@wordlessitguy

Description

@wordlessitguy

When creating or updating a vnet using Azure CLI you can set DNS servers (using --dns-servers command) - however there does not appear to be a way to reset this back to the Azure-provided DNS using the Azure CLI (other than using a generic update argument to remove dhcpOptions?).

This is possible on a network interface -

`
Command
az network nic update : Update a network interface.

Arguments
--accelerated-networking : Enable accelerated networking. Allowed values: false, true.
--ip-forwarding : Enable IP forwarding. Allowed values: false, true.
--network-security-group : Name or ID of the associated network security group.
--no-wait : Do not wait for the long-running operation to finish.

DNS Arguments
--dns-servers : Space-separated list of DNS server IP addresses. Use ""('""' in
PowerShell) to revert to default Azure servers.

`

Solution -

Use same solution as above for a vnet (--dns-servers ""('""') or add flag (--az-provideddns) to reset DNS back to Azure provided DNS.

Additional note - update the DNS arguments note or documentation on how to revert when using bash?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions