










import com.baidubce.http.ApiExplorerClient; import com.baidubce.http.AppSigner; import com.baidubce.http.HttpMethodName; import com.baidubce.model.ApiExplorerRequest; import com.baidubce.model.ApiExplorerResponse; // 域名DNS信息查询 Java示例代码 public class RequestDemo { public static void main(String[] args) { String path = "https://yykfymdnsjx.api.bdymkt.com/domain/dns/query"; ApiExplorerRequest request = new ApiExplorerRequest(HttpMethodName.POST, path); request.setCredentials("您的 access key", "您的 secret key"); request.addHeaderParameter("Content-Type", "application/x-www-form-urlencoded"); ApiExplorerClient client = new ApiExplorerClient(new AppSigner()); try { ApiExplorerResponse response = client.sendRequest(request); // 返回结果格式为Json字符串 System.out.println(response.getResult()); } catch (Exception e) { e.printStackTrace(); } } }点击复制代码
{
"code": 200,//详见code返回码说明
"msg": "成功",//code对应的描述
"taskNo": "012254029249104800787963",//本次唯一请求号
"data": {
"arecords": [ //ip4地址记录
{
"domain": "",// 域名
"name": "101.37.183.198",//ipv4地址
"type": "A", //类型
"dclass": "IN",
"ttl": 40 //ttl值
}
],
"aaaaRecords": [ //ipv6地址记录
{
"domain": "",//域名
"name": "240e:f7:c010:1401:3:0:0:3f9",//ipv6地址
"type": "AAAA",//类型
"dclass": "IN",
"ttl": 10 //ttl值
}
],
"cnameRecords": [ //名域记录
{
"domain": "",//域名
"name": "www.163.com.163jiasu.com.",//别名域
"type": "CNAME",//类型
"dclass": "IN",
"ttl": 231 //ttl值
}
],
"txtRecords": [ //txt记录
{
"domain": "",// 域名
"name": "\"verify_603bb76b210bcf37b2265656d46f7682\"", // txt值
"type": "TXT",
"dclass": "IN",
"ttl": 600
}
]
}
}
{
"msg": "域名不能为空",
"code": 400
}
1,官方直连,权威校验;2,全实时优质接口,不参缓存,品质保证;3,多通道冗余切换,稳定可靠。

