Main function of a nitrogenous base is to act as building blocks of DNA and RNA.

there are 5 nitrogenous bases:- Adenine,Guanine,Thymine,Cytosine and Uracil.

BUT IN DNA URACIL IS ABSENT AND IN RNA THYMINE IS ABSENT

Nitrogenous bases in DNA: Adenine,Thymine,Guanine and Cytosine

Nitrogenous bases in RNA: Adenine,Uracil,Guanine and Cytosine

That's why there are only 4 bases present in RNA and 4 bases in DNA.

More Info: en.wikipedia.org