The URL for my printer generated by hp-makeuri looks like this:


But the printer is on a dhcp enabled wifi network and so its IP-address does and could change. On the other hand my wifi router seems smart enough to have some sort of DNS:

$ ping hp-6500a
PING hp-6500a.fritz.box ( 56(84) bytes of data.
64 bytes from hp-6500a.fritz.box ( icmp_req=1 ttl=255 time=11.3 ms

I tried to use the hostname in the CUPS URL/DeviceUID but it failed, any suggestions if this is possible and the correct format?


I think you can make use of ZeroConf here to dynamically find your printer. The syntax is like:


There, zc stands for ZeroConf, the mDNS implemented by avahi. On setting that URI, you may see some multicast network traffic to query the printer as can be seen in the partial tcpdump below.

root@ubuntu:/etc/avahi# tcpdump -vvvvvn -i wlan0 host
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes
11:20:49.783337 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto UDP (17), length 59) > [udp sum ok] 0 A (QM)? printer.local. (31)
11:20:49.787975 IP (tos 0x0, ttl 255, id 44750, offset 0, flags [none], proto UDP (17), length 69) > [udp sum ok] 0*- [0q] 1/0/0 printer.local. (Cache flush) [4m] A (41)

DNS A records like printer.anintranet.example can be added to a dynamic zone by the DHCP server. The original domain name (anintranet.example) is discarded -- possibly because it is in the "search" directive of /etc/resolv.conf?-- and .local is added as part of the mDNS query.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.