我正在测试 google cloud dns,并尝试使用 gcloud 命令创建 TXT 记录。然而,创建的记录却意外逃脱。
这就是我所做的:
% gcloud dns 记录 --zone="myzonename" 编辑
在“添加”部分,我添加了这样的 TXT 记录:
{
"kind": "dns#resourceRecordSet",
"name": "example.com.",
"rrdatas": [
"v=spf1 include:_spf.google.com ~all",
],
"ttl": 84600,
"type": "TXT"
},
gcloud 命令没有错误退出,并且在我的区域中创建了 TXT 记录。但是,创建的记录如下所示:
{
"kind": "dns#resourceRecordSet",
"name": "example.com.",
"rrdatas": [
"\"v=spf1\" \"include:_spf.google.com\" \"~all\"",
],
"ttl": 84600,
"type": "TXT"
},
如您所见,双引号保留在数据中。我验证了来自 DNS 服务器的响应还包括双引号和空格。
% nslookup -type=TXT example.com. ns-cloud-e1.googledomains.com.
Server: ns-cloud-e1.googledomains.com.
Address: 216.239.32.110#53
example.com text = "v=spf1" "include:_spf.google.com" "~all"
预期输出为example.com text = "v=spf1 include:_spf.google.com ~all"
我怎样才能阻止这种不必要的转义?