Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

Check Website Resolves?

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
NamecheapNamecheap
Watch

peaches017

Established Member
Impact
134
Is there any script out there that can quickly check if a website is resolving?

I need to input a list of domains in .txt format and it should tell me:

Google.com resolves
SampleName.com doesn't resolve

I would be willing to buy this script or pay to have it coded.

Peter
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
I just wrote this now.

Cba to sort out port 443 too. Simple change if you want to do it.

PHP:
<?php

/**
 * Danltn | http://danltn.com/
 * MSN: [email protected]
 * Email: [email protected]
 * Started: 12/5/2008 17:25 (UK) 
 * Tested: No
 * PHP 4/5: Both
 * No warranty is given to code used
 */

define('TIMEOUT', 5);
define('UP_MESSAGE', '%s resolves.');
define('DOWN_MESSAGE', '%s doesn\'t resolve.');
define('LINE_BREAK', "<br />\n");
define('EXTRA_FLUSH', true);

/* Timeout -> Int
* Up_message -> Str
* Down_message -> Str
* Line Break -> Str
* Extra_flush -> Bool
*/

if (isset($_POST['submit']))
{
    $list = (get_magic_quotes_gpc()) ? stripslashes($_POST['list']) : $_POST['list'];
    $list = str_replace("\r", '', $list);
    $urls = explode("\n", $list);
    if (count($urls) > 0)
    {
        while (list(, $url) = each($urls))
        {
            if (!$url)
            {
                continue;
            }
            if (substr($url, 0, 4) === 'http')
            {
                $url = preg_replace('https?://', '', $url);
            }
            if (@fsockopen($url, 80, $errno, $errstr, TIMEOUT))
            {
                printf(UP_MESSAGE, $url);
            }
            else
            {
                printf(DOWN_MESSAGE, $url);
            }
            echo LINE_BREAK;
            if (EXTRA_FLUSH === true)
            {
                ob_flush();
                flush();
            }
        }
    }
    die();
}

?>
<form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>">
	<textarea rows="20" cols="60" name="list"></textarea><br />
	<input type="submit" name="submit" value="Check" />
</form>
 
Last edited:
0
•••
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back