If the person suffering damage because of the trespass of livestock which has been taken up under this chapter does not know the name of the owner or keeper of the livestock, the person may bring an action against an unknown defendant. In such case, service must be made by publication of a copy of the summons, with a notice attached, stating the nature of the action, in at least one issue of a legal newspaper if one is published within the county, and if not, by posting copies of the summons and notice in three public places within the county. The publication or posting must be made at least ten days before the date of the trial. If it appears on the trial of any action brought to recover damages arising from the trespass of livestock that the person named in the action and upon whom the summons was served is not the owner or person in charge of the offending livestock, the action must be dismissed as to that person, and service must be made, and the action must proceed, as in a case in which the name of the owner or keeper of the offending livestock is unknown.
N.D.C.C. § 36-11-14