Home
> Uncategorized > How to export a list of domains from #namecheap
How to export a list of domains from #namecheap
I wanted to check the IP address of all the domains I had registered with namecheap, so I wanted to write a batch file to ping them all, so first step, was to export a list from namecheap. I couldn’t find the option, so I asked namecheap support who said there wasn’t an option.
But that just got me to look harder!
So, I enabled their API under Profile-Tools-API Access, whitelisted my IP, and created an api key, and with a bit of research, I got this:
Categories: Uncategorized
Thanks i was looking for this too. namecheap should really have an export function like managemysitefor.me does or godaddy.com does…. but this api call is good enough for me!
LikeLike
They still don’t offer export, but you can request a CSV export via live chat
LikeLike
Some handy code to download site list from namecheap, and check each domain for IP address (i.e. everything pointing to right server)
var web = new WebClient();
var domains = web.DownloadString(url);
var xdoc = new XmlDocument();
xdoc.LoadXml(domains);
var ns = new XmlNamespaceManager(xdoc.NameTable);
ns.AddNamespace(“xx”, “http://api.namecheap.com/xml.response”);
var domainList = xdoc.SelectNodes(“//xx:Domain”, ns);
foreach (XmlNode domain in domainList)
{
var name = domain.Attributes[“Name”].InnerText;
try
{
var ip = Dns.GetHostAddresses(name);
Console.WriteLine(name + “::” + ip.First());
}
catch (Exception e)
{
Console.WriteLine(name + “::ERROR”);
}
}
LikeLike