Namecheap-dot-net
Namecheap-dot-net copied to clipboard
A .NET wrapper for the Namecheap API
Namecheap-dot-net
A .NET wrapper for the Namecheap API, with support for the NameCheap Sandbox.
Sample Code
Check the availability of several domain names
var api = new NameCheapApi("{username}", "{apiUser}", "{apiKey}", "{clientIp}", isSandbox: false);
var domains = api.Domains.AreAvailable("google.com", "ANewDomainName");
foreach (var domain in domains)
Console.WriteLine(domain.DomainName + ": " + domain.IsAvailable);
Set DNS host records for a given domain in the Sandbox
var api = new NameCheapApi("{username}", "{apiUser}", "{apiKey}", "{clientIp}", isSandbox: true);
api.Dns.SetHosts(
new DnsHostsRequest
{
SLD = "YourDomainName",
TLD = "com",
HostEntries = new HostEntry[] { new HostEntry() {
Address = "192.168.1.1",
HostName = "@",
RecordType = RecordType.A
} }
});