Add DNS Srv Records to SimpleDNS 5 Provider
This commit is contained in:
parent
3689584b7f
commit
5b6a52544c
1 changed files with 26 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2012, Outercurve Foundation.
|
// Copyright (c) 2012, Outercurve Foundation.
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without modification,
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
@ -99,7 +99,9 @@ namespace WebsitePanel.Providers.DNS
|
||||||
{ DnsRecordType.MX, new BuildDnsRecordDataEventHandler(BuildRecordData_MXRecord) },
|
{ DnsRecordType.MX, new BuildDnsRecordDataEventHandler(BuildRecordData_MXRecord) },
|
||||||
// TXT
|
// TXT
|
||||||
{ DnsRecordType.TXT, new BuildDnsRecordDataEventHandler(BuildRecordData_TXTRecord) },
|
{ DnsRecordType.TXT, new BuildDnsRecordDataEventHandler(BuildRecordData_TXTRecord) },
|
||||||
};
|
// SRV
|
||||||
|
{ DnsRecordType.SRV, new BuildDnsRecordDataEventHandler(BuildRecordData_SRVRecord) },
|
||||||
|
};
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public const int SOA_PRIMARY_NAME_SERVER = 0;
|
public const int SOA_PRIMARY_NAME_SERVER = 0;
|
||||||
|
@ -190,10 +192,20 @@ namespace WebsitePanel.Providers.DNS
|
||||||
RecordData = record.DataFields[0]
|
RecordData = record.DataFields[0]
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
case "SRV":
|
||||||
|
dnsRecord = new DnsRecord
|
||||||
|
{
|
||||||
|
RecordName = recordName,
|
||||||
|
RecordType = DnsRecordType.SRV,
|
||||||
|
RecordData = record.DataFields[3],
|
||||||
|
SrvPriority = Convert.ToInt32(record.DataFields[0]),
|
||||||
|
SrvWeight = Convert.ToInt32(record.DataFields[1]),
|
||||||
|
SrvPort = Convert.ToInt32(record.DataFields[2])
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
//
|
||||||
|
return dnsRecord;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
return dnsRecord;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Setups connection with the Simple DNS instance
|
/// Setups connection with the Simple DNS instance
|
||||||
|
@ -663,6 +675,15 @@ namespace WebsitePanel.Providers.DNS
|
||||||
data.Add(record.RecordData);
|
data.Add(record.RecordData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void BuildRecordData_SRVRecord(string zoneName, ref string type, DnsRecord record, List<string> data)
|
||||||
|
{
|
||||||
|
type = "SRV";
|
||||||
|
data.Add(Convert.ToString(record.SrvPriority));
|
||||||
|
data.Add(Convert.ToString(record.SrvWeight));
|
||||||
|
data.Add(Convert.ToString(record.SrvPort));
|
||||||
|
data.Add(record.RecordData);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
new static string BuildRecordData(string zoneName, string host, string recordData)
|
new static string BuildRecordData(string zoneName, string host, string recordData)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue