SeekfordSolutions.DNSMXWizard Class Library

ZoneOfAuthorityData Class

ZoneOfAuthorityData Members

A Zone of Authority specific data record used in ResourceRecord.Data

        [C#]
        public class ZoneOfAuthorityData : Object
      

Remarks

The Zone Of Authority records provide information about the authority servers for the domain name and the additional information about how long the records should be kept valid.

Example

The following code example queries a DNS server and obtains the Zone of Authority records for a domain

using System; 
using SeekfordSolutions.DNSMXWizard;

public class MyClass {

	public static void Main() 
	{
		DNSClient myDNSClient = new DNSClient("Serial Number");
		ArrayList myDNSServers = new ArrayList();
		myDNSServers = myDNSClient.GetSystemDNSServers();
		myDNSClient.SetServers(myDNSServers);
		Console.WriteLine("Please wait!");
		Response myDNSResponse;
		ZoneOfAuthorityData myZoneData;	
		ArrayList myResponses;
		try
		{
			myResponses  = myDNSClient.ZoneOfAuthorityLookup("www.SeekfordSolutions.com");
			Console.WriteLine("Zone Authority Lookup");
			if(myResponses  != null)
			{
				Console.WriteLine(String.Format("NameServer\tMailingAddress\tRetry\tMinTTL\tRefresh\tExpire\tSerial");
				for(int iX = 0; iX < myResponses.Count; iX++)
				{							
					myZoneData = (ZoneOfAuthorityData)myResponses[iX] ;
					if(myZoneData != null)
						Console.WriteLine(String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\r\n",myZoneData.PrimaryNameServer,myZoneData.ResponsibleMailingAddress,myZoneData.Retry,myZoneData.MinimumTTL ,myZoneData.Refresh,myZoneData.Expire,myZoneData.Serial));
				}
			}
			else
			{
				Console.WriteLine("No Response!");
			}
		}
		
		catch(Exception err)
		{
			Console.WriteLine(err.Message.ToString());				
		}
	}
}

/*
	
This code produces the following output:
Please wait!
Zone Authority Lookup
NameServer	MailingAddress	Retry	MinTTL	Refresh	Expire	Serial
dns.1st.net	dns.1st.net	3600	43200	10800	604800	2003082502
*/

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

See Also

DNSMXWizard Namespace