In this paper, by the introduction of several parameters, we construct a new kernel function which is defined in the whole plane and includes some classical kernel functions. Estimating the weight functions with the techniques of real analysis, we establish a new Hilbert-type inequality in the whole plane, and the constant factor of the newly obtained inequality is proved to be the best possible. Additionally, by means of the partial fraction expansion of the tangent function, some special and interesting inequalities are presented at the end of the paper.