Skip to content

Instantly share code, notes, and snippets.

@himajin315
Last active January 3, 2016 10:39
Show Gist options
  • Save himajin315/8451344 to your computer and use it in GitHub Desktop.
Save himajin315/8451344 to your computer and use it in GitHub Desktop.
dns_get_record を使ったサンプルコード。
<!DOCTYPE html>
<head>
<title>DNS Search</title>
<meta charset="UTF-8">
<link ref="stylesheet" href="style.css" type="text/css">
</head>
<body>
<h1>DNS Search</h1>
<form action="dns_get_record.php" method="get">
ホスト名: <input type="text" name="host">
<input type="submit" value="送信">
</form>
<?php
if(isset($_GET['host'])){
$host_name = $_GET['host'];
//DNSレコードを取得する
$result = dns_get_record($host_name);
//結果を表示
if($result){
echo "<pre>";
print_r($result);
echo "</pre>";
}else{
echo '見つかりませんでした。';
}
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment