Skip to content

Commit bc12ed0

Browse files
committed
Added more examples to do-dns
1 parent 3e3ad01 commit bc12ed0

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

examples/network/do-dns.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const domainCreateOptions={
2222
const domainName="example.com";
2323

2424
function createRecord(){
25-
2625
dns.createRecord(domainName,domainCreateOptions)
2726
.then((result) => {
2827
console.log("Output is: ",result);
@@ -41,8 +40,8 @@ function getAllRecords(){
4140
});
4241
}
4342

44-
function getRecords(){
45-
var recordID="3352896";
43+
function getRecord(){
44+
let recordID="3352896";
4645
dns.getRecord(domainName,recordID)
4746
.then((result)=>{
4847
console.log("Record are: ",result);
@@ -52,5 +51,29 @@ function getRecords(){
5251
})
5352
}
5453

54+
function deleteRecord(){
55+
let recordID="3352896";
56+
dns.deleteRecord(domainName,recordID)
57+
.then((result)=>{
58+
console.log("Output is: ",result);
59+
})
60+
.catch((err)=>{
61+
console.log("Error is: ",err);
62+
})
63+
}
5564

65+
function changeRecord(){
66+
let recordID="3352896";
67+
let options={
68+
"name": "blog",
69+
"type": "CNAME"
70+
}
71+
changeRecordSets(domainName, recordID, options)
72+
.then((result)=>{
73+
console.log("Output is: ",result);
74+
})
75+
.catch((err)=>{
76+
console.log("Error is: ",err);
77+
})
78+
}
5679

0 commit comments

Comments
 (0)