#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    15
    Rep Power
    0
    I want to validate the domain name of an email address in my scripts to see if the domain exists.
    To make it easier I just want to check the TLD and the 2nd LD (e.g. devshed.com).

    Anyone any ideas on how to tackle this challenge?

    Ciao,
    DiPesa
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    To validate whether an email address is in proper format is NOT the same as to validate whether the domain part of an email actually exist.

    To validate the email format, just click the search link on this page as it has been discussed dozen times.
    As for the other case, you need launch an external program/command to determine the existence of that domain. i.e. nslookup.
  4. #3
  5. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,642
    Rep Power
    4476
    Look under Network Functions in the PHP Manual. There are some functions for getting IP addreses from Host names. You might be able to do something like this:

    $ip = gethostbyip("devshed.com");

    If it returns an IP address, you can assume the hostname is valid...That example might not work exactly, I can't remember the name of the function exactly.

    ---John Holmes...

Similar Threads

  1. Domain Controller Swapping
    By estekguy in forum Windows Help
    Replies: 2
    Last Post: February 5th, 2004, 12:46 PM
  2. Win2k domain user dont appear in WinNT domain
    By VoooDooo in forum Windows Help
    Replies: 0
    Last Post: February 2nd, 2004, 04:55 AM
  3. extract domain from link
    By Rooseboom in forum PHP Development
    Replies: 4
    Last Post: December 15th, 2003, 02:09 AM
  4. Replies: 4
    Last Post: August 5th, 2003, 10:56 AM
  5. ideas for switching domain names
    By naclu in forum Project Help Wanted
    Replies: 1
    Last Post: April 30th, 2003, 04:21 PM

IMN logo majestic logo threadwatch logo seochat tools logo