# Distinguishing Brown Ring Test for Nitrates and Nitrites

My question is how will one detect the presence of nitrates by brown ring test when nitrites are also present in the solution?

Brown Ring Test for Nitrite
$\ce{NO_2^- + H+ -> HNO2}$
$\ce{3HNO2 -> H2O + HNO3 + 2NO}$
$\ce{FeSO4 + 6H2O -> [Fe(H2O)6]SO4}$ $\ce{[Fe(H2O)6]SO4 + NO -> [Fe(H2O)5NO]SO4 + H2O}$

Brown Ring Test for Nitrate
$\ce{2NO_3^- + 6Fe^2+ +4H2SO4 -> 6Fe^3+ + 4SO4^2- + 2NO + 4H2O}$
$\ce{FeSO4 + H2O -> [Fe(H2O)6]SO4}$
$\ce{[Fe(H2O)6]SO4 + NO -> [Fe(H2O)5NO]SO4 + H2O}$

Note: I personally think that it may have something to do with preventing oxidation of nitrites to nitrates and the release of NO (nitric oxide). But I am not quite sure how to go about that.

Yes, you are quite right. It has something to do with prevention of oxidation of nitrites. By controlling the pH, the nitrite present is reduced to nitric oxide ($$\ce{NO}$$) which reacts with ferrous sulfate to form a brown-colored complex ion, $$\ce{FeSO4.NO}$$. Nitrates do not react in such way and thus not registered in the test. It uses a special agent to prevent color formation or precipitation of common interfering ions. Here is the relevant information[1]:
In an acidic medium ferrous sulfate reduces nitrogen in nitrite ($$\ce{NO2–}$$) to form nitrous oxide ($$\ce{NO}$$). Ferrous ions combine with the nitrous oxide to form a brown-colored complex ion, the color intensity of which is in direct proportion to the nitrite present in the water sample. Color development follows Beer’s Law.
$$\ce{2Fe^2+ + 4H+ + 2NO2‾ → 2Fe^3+ + 2NO + 2H2O}$$
$$\ce{NO + FeSO4 → FeSO4·NO}$$