Check if a domain exists

Discussion in 'PHP' started by Joseph S, Aug 15, 2008.

  1. #1
    What`s the best method to check if a domain exists? .. using PHP of course! :)
    I need something that will work with all the domain extensions out there.
    Would checkdnsrr be the solution?
     
    Joseph S, Aug 15, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    checkdnsrr will return the DNS records, but not every domain has DNS records (i.e. some dropped/newly registered domains have 'No Nameserver' in the Whois). Speaking of whois, I think that's the way forward. Only downside is you need to know the reponse, and servers, for every TLD.

    I hope that helped,

    Jay
     
    jayshah, Aug 15, 2008 IP
  3. Joseph S

    Joseph S Well-Known Member

    Messages:
    1,373
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    155
    #3
    It is way to complicated to check the whois record for all those tlds.... I am thinking about finding a domains IP, if that can be found we will consider it as active, if not, even if it is registered, it is not active.
    What you think?
     
    Joseph S, Aug 15, 2008 IP
  4. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #4
    If all the available nameservers are down, the script will return "not active" for domains that are actually active.

    www.php.net/gethostbyname

    That's the function you want, though.

    Jay
     
    jayshah, Aug 15, 2008 IP
    BuyTubeView likes this.
  5. Joseph S

    Joseph S Well-Known Member

    Messages:
    1,373
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    155
    #5
    Thanks jayshah, that helped me a lot! I have managed to implement what I needed.
     
    Joseph S, Aug 15, 2008 IP