Open fff7d1bc opened 1 year ago
Same Problem here with Prusa 2.7 on Fedora 38 with Kernel 6.5.12 !
Prusa is the only application, that can't resolve my printers hostname.
I feel like resolving a local hostname is more valuable to generic users, than resolving via DNS. Who has a printer resolved by a DNS? Most users probably just wan't to use the local hostname and don't worry about local IPs in their home network.
I've seen applications generally developed to allow for mDNS querying by flat-out filtering "*.local" suffix from any type of standard DNS query. And instead, query mDNS resolver.
There are security precautions here to take account: leaking DNS lookups of local devices and services to your ISP, and all... This is why we take ".local" and just query a resolver for it, skipping the dns lookup. Anything else but ".local" goes through the normal flow.
(this is why it is impossible to switch from .local and have it work in all apps, mobiles, etc - just let it go, leave it .local)
Description of the bug
I am running Linux and have the avahi/mdns configured system wide using
/etc/nsswitch.conf
The resolver works as long as it uses system resolver, that is, anything that will run
gethostbyname()
of libc will work. However when I use PrusaSlicer and add my physical printer with hostnamevoron-v0.local
then it cannot resolve itI did run the slicer though
strace
and what I seen is that the PrusaSlicer, instead of using system resolver, it directly queries the DNS server, which in my case are Google DNS, so clearly they cannot resolvevoron-v0.local
address.I suspect this is not an accident that it works this way and most likely was made to not try to use system resolver as the default distribution of PrusaSlicer is statically linked so you cannot really rely on the libc you find there.
In my case this is PrusaSlicer 2.6.0 built natively on Gentoo Linux running glibc.
Potentially the way to solve it without adding you too much other problems would be to create fallback mechanism, that if standard name resolution fails you could instead fallback to call
getent hosts HOSTNAME.local
and read it's stdout. It is there on both musl libc and glibc and is the standard, though that would mean that you can no longer to just rely on the mechanism that will transparently for you resolve the dns and connect there but you'd need to control it, resolve host to IP and only then make connection to IP, on the top of that, every time you connect there, so every time a buttontest
is clicked or when one sends gcode to printer.Project file & How to reproduce
1, Have Linux
nssswitch.conf
HOSTNAME.local
domainChecklist of files included above
Version of PrusaSlicer
2.6.0
Operating system
Gentoo ~amd64 glibc
Printer model
Voron v0.2