openstack Verified current stable Not installed? Cloud Infrastructure

Openstack / Update Subnet With Dns

Update Subnet With Dns

Updates specific attributes for an existing OpenStack subnet.

$
Terminal
openstack subnet set --dns-nameserver 8.8.8.8 --name <new_subnet_name> <subnet_id>

When To Use

When changing DNS settings for existing subnets in response to network policy changes.

Pro Tip

Setting `--dns-nameserver` updates the DNS resolver; ensure it complies with internal DNS policies.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
openstack subnet set --dns-nameserver 8.8.8.8 --name <new_subnet_name> <subnet_id>

Anatomy of Output

Understanding the result

+--------------+-------------------+ Header: Subnet Update Confirmation

Indicates the output of the update operation.

| id | subnet-123456 | Updated Subnet ID

Confirms which subnet was modified.

| name | new_subnet_name | New Subnet Name

Indicates the updated name for the subnet.

| dns_nameservers | 8.8.8.8 | Updated DNS Server

Shows the DNS server that has been updated.

Troubleshooting

Common pitfalls

ERROR: Subnet 'subnet-xyz' not found.

Solution: Verify the subnet ID is correct before attempting an update.

ERROR: InvalidInput: DNS nameserver must be an IP address.

Solution: Ensure the value provided for DNS nameserver is a valid IPv4 or IPv6 address.

ERROR: Forbidden: You do not have permission to perform this action.

Solution: Verify access rights for updating the subnet in your OpenStack project.

Command Breakdown

What each part is doing

openstack
Base Command
The executable that performs this operation. Here it runs Openstack before the shell applies any redirect operators.
<new_subnet_name>
new subnet name
The value supplied for new subnet name.
<subnet_id>
subnet id
The value supplied for subnet id.
--dns-nameserver
Command Option
Tool-specific option used by this command invocation.
--name
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.