question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reverse lookups and PTR packages

See original GitHub issue

Lets say I know the ip of brunhilde.local and want to know its host name (i.e. brunhilde.local!). So I build up my query like this:

mdns.query({questions:[{name:'26.178.168.192.in-addr.arpa.',type:'PTR'}]});

What I can see when I monitor the network using Wireshark is that the mDNS query is malformed and type and class are missing:

26.178.168.192.in-addr.arpa: type Unused, class Unknown (3072), "QM" question

A valid query (e.g. generated using dig -p 5353 @224.0.0.251 -x 192.168.178.26) would be as the following:

26.178.168.192.in-addr.arpa: type PTR, class IN, "QM" question

unfortunately I didn’t have enough time to get deep into the code to see if I’m doing something wrong (or undesired) or is it a valid bug. Any help is appreciated.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
thenewwazoocommented, Dec 28, 2020

Progress! If I specify rinfo in my query, I see a response back on the network. The code now looks like


        let resolver = mdns({
            multicast: true,
            ttl: 1,
            port: 0,
        });

        resolver.query({
            flags: 1 << 8 | 1 << 5,
            id: getRandomInt(1, 65534),
            questions: [
                {
                    name: reversed,
                    type: 'PTR',
                    class: 'IN'
                },
            ],
            additionals: [
                {
                    name: '.',
                    type: 'OPT',
                    udpPayloadSize: 0x1000,
                },
            ],
        }, {
                      port: 5353,
                      address: "224.0.0.251",
        });

~The problem I’m having now is that nodejs never seems to receive the response datagram that I can see in packet capture.~ Looks like I had a bug in my response handler code, and I am now successfully doing reverse lookups.

0reactions
yan-fotocommented, Dec 26, 2020

@thenewwazoo it seems that @mafintosh is most probably like the rest of use have limited time for maintenance 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a PTR Record and How to Do Reverse IP Lookup?
A PTR record is well-known as the reverse version of an A record. While A record maps the domain name to an IP...
Read more >
What Is Reverse DNS and How Does It Work? - phoenixNAP
A PTR record is used to perform reverse DNS lookups. Pointer records are configured within Address and Routing Parameter Area ( in-addr.arpa ) ......
Read more >
Reverse DNS Record, PTR, Pointer Record | HostGator Support
A PTR is a reverse record for an IP address that allows an IP to map to a domain and vice versa. That...
Read more >
What is PTR Record? - ClouDNS
PTR records (or Pointer records) are used for the Reverse DNS (Domain Name System) lookup. Using the IP address you can get the...
Read more >
Reverse DNS Lookup - Plesk
There is a specific PTR record, called the name portion, which stores entries that make reverse DNS lookup possible.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found