Click here to Skip to main content
11,789,512 members (51,035 online)
Rate this: bad
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 at 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 at 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 at 24-Nov-13 2:46am
Worked for me too!! searching this from 2 days
Pankaj Nikam at 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
0 OriginalGriff 954
1 Maciej Los 765
2 KrunalRohit 666
3 CPallini 606
4 Richard MacCutchan 420

Advertise | Privacy | Mobile
Web01 | 2.8.1509028.1 | Last Updated 21 Jun 2012
Copyright © CodeProject, 1999-2015
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