A zebrafish gene with sequence similarities to human uromodulin and GP2 displays extensive evolutionary diversification among teleost and confers resistance to bacterial infection. Here, GP2 is linked to bacterial infectious disease.