Use has_nav_menu
e.g.
$menu_name=$_SERVER[\'SERVER_NAME\'];
$menu_name=str_ireplace("WWW.","",$menu_name);
$menu_name=str_ireplace(".","",$menu_name);
$menu_name = sanitize_title($menu_name); // sanitize!
if(has_nav_menu($menu_name)){
wp_nav_menu(array(\'menu\' => $menu_name));
}