4.3. 将端口与 DNS 集成
网络服务(neutron)和 DNS 服务(指定)之间的集成可让您在创建端口时自动添加 DNS 记录。
先决条件
- 您的云管理员为您提供了创建启用了 DNS 的端口时所需的网络。
流程
提供您的凭据文件。
示例
$ source ~/overcloudrc使用云管理员提供的区域和网络,创建一个端口。
示例
在本例中,云用户会创建一个端口
my-port,在网络中带有example-port的 DNS 名称,example-network:$ openstack port create --network example-network \ --dns-name example-port \ my-port
验证
确认 DNS 服务中存在您创建的端口的记录。
示例
在本例中,会查询 DNS 服务以获取
example.com.区域:$ openstack recordset list --type A example.com.输出示例
+---------------+---------------------------+------+-------------+--------+--------+ | id | name | type | records | status | action | +---------------+---------------------------+------+-------------+--------+--------+ | 9ebbe94f-2442 | example-port.example.com. | A | 192.0.2.149 | ACTIVE | NONE | | -4bb8-9cfa-6d | | | | | | | ca1daba73f | | | | | | +---------------+---------------------------+------+-------------+--------+--------+