Revision a812abb3
Added by Scott Ullrich almost 15 years ago
usr/local/www/diag_dns.php | ||
---|---|---|
82 | 82 |
} elseif (is_hostname($host)) { |
83 | 83 |
$type = "hostname"; |
84 | 84 |
$resolved = gethostbyname($host); |
85 |
$dig=`dig www.cnn.com A | grep "www.cnn.com" | grep -v ";" | awk '{ print $5 }'`; |
|
86 |
$resolved = split("\n", $dig); |
|
85 | 87 |
$hostname = $host; |
86 | 88 |
if ($host != $resolved) |
87 | 89 |
$ipaddr = $resolved; |
... | ... | |
108 | 110 |
<tr> |
109 | 111 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname or IP");?></td> |
110 | 112 |
<td width="78%" class="vtable"> |
111 |
<?=$mandfldhtml;?><input name="host" type="text" class="formfld" id="host" size="20" value="<?=htmlspecialchars($host);?>"> |
|
113 |
<?=$mandfldhtml;?> |
|
114 |
<table> |
|
115 |
<tr><td valign="top"> |
|
116 |
<input name="host" type="text" class="formfld" id="host" size="20" value="<?=htmlspecialchars($host);?>"> |
|
117 |
</td> |
|
118 |
<td> |
|
112 | 119 |
<? if ($resolved && $type) { ?> |
113 |
= <font size="+1"><?php echo $resolved; ?><font size="-1>"> |
|
120 |
= <font size="+1"> |
|
121 |
<?php |
|
122 |
if(is_array($resolved)) { |
|
123 |
foreach($resolved as $hostitem) { |
|
124 |
echo $hostitem . "<br/>"; |
|
125 |
} |
|
126 |
} else { |
|
127 |
echo $resolved; |
|
128 |
} |
|
129 |
?> |
|
130 |
<font size="-1>"> |
|
114 | 131 |
<? } ?> |
132 |
</td></tr></table> |
|
115 | 133 |
</td> |
116 | 134 |
</tr> |
117 | 135 |
<?php if($_POST): ?> |
Also available in: Unified diff
Teach the DNS Lookup util to grok multiple host entries