当前环境
a.v.com 1.1.1.1 b.v.com 2.2.2.2
希望绑域名 y.v.com 能够嗟系 1.1.1.1 及 2.2.2.2 以实现 DNS 负载均衡
错误做法
mysql> insert into records (domain_id, name, type, content, ttl) values ( 1,'y.v.com', 'CNAME','a.v.com,'360'); Query OK, 1 row affected (0.00 sec) mysql> insert into records (domain_id, name, type, content, ttl) values ( 1,'y.v.com', 'CNAME','b.v.com','360'); Query OK, 1 row affected (0.00 sec)
正确做法
mysql> insert into records (domain_id, name, type, content, ttl) values ( 1,'y.v.com', 'A','1.1.1.1','360'); Query OK, 1 row affected (0.00 sec) mysql> insert into records (domain_id, name, type, content, ttl) values ( 1,'y.v.com', 'A','1.1.1.2','360'); Query OK, 1 row affected (0.00 sec) mysql> update records set content='pdns.vclound.com admin.pdns.vclound.com 2609 1200 7200 64800' where id=1; Query OK, 1 row affected (0.00 sec)
客户端测试效果如下
[root@hh-yun-puppet-129021 named]# nslookup yum.vclound.com Server: 10.199.129.21 Address: 10.199.129.21#53 Name: yum.vclound.com Address: 10.199.129.22 Name: yum.vclound.com Address: 10.199.129.21