I would break list into parts (each row being a part)
then search each part for the occurance of host2
if its there, delete the part, or simply don't use it
if its not, all is good..
say for instance..
$parts = explode("</tr>", $list);
for($i = 0; $i<count($parts)-1; $i++)
{
if(!(SEARCH FOR host2 in $parts[$i]))
{
echo $parts[$i] . '</tr>';
}
}
rough idea of how I'd do it.