Home

Bookmark and Share

DNS Library Icon Dynamic DNS Update Library

Frequently Asked Questions

The Dynamic DNS Update Library is available for download here. You can use the Edit > Find (on This Page)... menu (or Ctrl+F) in your browser to search the FAQ.

Separator

1. How do I delete a resource record (RR)?

Here is an example in JavaScript that will delete the A record of a hostname. Authentication is not shown for clarity. You'd also have to customize the record name (www.yourzone.com) and the DNS server name (ns.domainname.com).

// Instantiate the DNS objects

var oDNS = new ActiveXObject("DnsLibrary.DnsServer");
var oRRSet = new ActiveXObject("DnsLibrary.ResourceRecordSet");


// Create a record object representing the A record to delete

var oRR = oRRSet.New();


// Name: www
// Type: A
// Data: 
// Note: records with data parameter empty are deleted

oRR.Set("www", "A", "");


// Add the new Resource Record to the record set

oRRSet.Add(oRR);


// Connect to the DNS server

if (!oDNS.Connect("ns.domainname.com", 53))
{
	alert("failed to connect");
	return;
}


// Update the DNS server
// Delete the www.yourzone.com A record

if (oDNS.Update("yourzone.com", oRRSet))
{
	alert("record successfully deleted");
}
else
{
	alert("could not delete record on server");
}