Click here to Skip to main content
13,046,356 members (67,947 online)
Rate this:
Please Sign up or sign in to vote.
Hi friends,
i want to add domain name finding utility in my web site . is any web service is available for ?
Posted 21-Jun-12 4:06am
Manas Bhardwaj 21-Jun-12 10:08am
Not clear!

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Following is a simple console program which checks whether if the domain name exists or not.

You can convert it into a webservice if you wish to.

using System;
using System.Linq;
using System.Net;
using System.Net.Sockets;
namespace DemoDNS
    class Program
        static void Main(string[] args)
            Console.WriteLine("Please enter a domain for lookup.");
            var domainName = Console.ReadLine();
                var ipAddress = Dns.GetHostEntry(domainName);
                if (ipAddress.AddressList.Count() > 0)
                    Console.WriteLine("The domain already exists!");
            catch (SocketException e)
Pankaj Nikam 21-Jun-12 10:26am
This solution is given as far as I understand the need of yours. If not, please reply me on this comment, I would love to help you. Thanks.
Abhishek Pant 24-Nov-13 2:46am
Worked for me too!! searching this from 2 days
Pankaj Nikam 24-Nov-13 10:17am
Glad to be of help :)
Thanks for the upvote :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 21 Jun 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100