Use the printcap entry with the name or alias printer and use the information in that printcap entry. Example:
lpr -Plp look up printcap entry for 'lp'