lib/param: add lpcfg_sam_dnsname() helper function