For Fedora, for other distributions some paths need to be changed.
$ vi /etc/avahi/avahi-daemon.conf
domain-name=lip.pt
browse-domains=lip.pt
$ echo "ServerName printserv.lip.pt" >> /etc/cups/client.conf
$ systemctl enable cups-browsed.service
$ systemctl enable cups.service
$ systemctl enable avahi-daemon
$ systemctl restart cups-browsed.service
$ systemctl restart cups.service