It is unlawful to graze livestock on any part of the unreserved and unappropriated public lands of the United States in this State when such grazing will or does prevent, restrict or interfere with the customary use of such land for grazing livestock by any person who, by himself or his grantors or predecessors, has become established, either exclusively or in common with others, in the grazing use of such lands under and in accordance with the customs of the graziers of the region involved. This article shall not prohibit the grazing on any part of such public lands of livestock owned, kept or used for work or milking purposes by any ranch owner or bona fide settler, for his domestic use, as distinguished from commercial use, nor prohibit the grazing on such public lands of any livestock necessary for and used in connection with any mining or construction work or other lawful work of similar character.