-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong hostname under certain conditions #29
Comments
Happy New Year to you too! This is kind of strange. The packet dump you provided (kudos for that one by the way) actually have exactly what you describe. If i import it into wireshark I will get the same result, the last answer is "Cromecast.local". It looks as if chromecast messes with the host name if it contains dots. And it really should, dots are not allowed "within" the name, just as separators. The first answer, class 33/SRV, clearly show that the service Chromecast.Bedroom._googlecast._tcp.local points to a target with the name Chromecast.local. So, everything adds up as it should but I agree that it's sort of inconvenient. I can imagine this will create some issues if you have several devices which all begins with the same thing and then a dot in the name. The service names will differ but the host/target name would end up being the same but pointing to 2 different IPs. After some googeling I found a forum thread where the name is mentioned.
This might be a special case of that. Anyway, I am seriously thinking about just closing this issue since it isn't a error. It correctly shows what the Chromecast device wants to show.
I can add some cosmetics to hide this fact but I still fear that one would end up with issues when there are 2 or more devices that end up with the same A name. |
Thank you, this makes sense. Strangely though, in Chrome the name is shown correctly and not fooled by my apparent misuse of dots. I agree that you can close this issue since it is not directly the fault of mdns-js. Quick question. If I wanted to always get just the name of the device, could I use the service-name and cut it when '._googlecast' is met reliably? I seem to remember in an earlier mdns-js version there was a field with just the name. |
I've encountered the same issue - TXT records with '.' in them are truncated. This is particularly problematic for A records, which have IP addresses in them. In our case we're also providing an info URL, which has a '.' in the file extension. This would also be problematic for your server example where version numbers have a '.' in them. This works correctly in the mDNS and mdns modules, but not your mdns-js module. |
@bfree-github please file as a separate issue, and please provide a dump of the message if possible. |
I found a case of mdns-js reporting the wrong hostname of my device.
When parsing the "additional" packet segments it gets obj.host from the A record, but on Chromecast, that record seems to be incorrect when there's a period in the name of the device. Here are the 3 additionals being parsed:
As you see the name is correct in the first 2 additionals but cut at the first period in the last one. I was also wondering if it would be possible to return a "pure" hostname without the .local part appended. Thanks in advance.
Oh and I know you like packet dumps:
Happy new year 😄
The text was updated successfully, but these errors were encountered: