Mastitis is one of the most important diseases of the mammary gland. The increased incidence of this disease in cows is due to the breeding of dairy cattle for higher yields, which is accompanied by an increased susceptibility to mastitis. Therefore, the difficulty involved with preventing this disease has increased. An integral part of current research is the elimination of mastitis in order to reduce the consumption of antibiotic drugs, thereby reducing the resistance of microorganisms and decreasing companies' economic losses due to mastitis (i.e. decreased milk yield, increased drug costs, and reduced milk supply). Susceptibility to mastitis is based on dairy cows' immunity, health, nutrition, and welfare. Thus, it is important to understand the immune processes in the body in order to increase the resistance of animals. Recently, various studies have focused on the selection of mastitis resistance genes. An important point is also the prevention of mastitis. This publication aims to describe the physiology of the mammary gland along with its immune mechanisms and to approximate their connection with potential mastitis resistance genes. This work describes various options for mastitis elimination and focuses on genetic selection and a closer specification of resistance genes to mastitis. Among the most promising resistance genes for mastitis, we consider CD14, CXCR1, lactoferrin, and lactoglobulin.