Binding to nucleic acid via hydrogen bonds between the bases of a gene product molecule and the bases of a target DNA molecule.
Comment:
Note that with respect to annotation, "base pairing" and its child terms are intended to be used to annotate the activity of gene products composed of nucleic acid, presumably RNA, to interact with DNA molecules via base pairing. Internal base pairing with itself is considered part of the secondary structure of the molecule and is not within the scope of GO function.