I thought avahi-resolve and dig -p 5353 @ did much the same thing.

However, I have a device where I can resolve its name using avahi-resolve but not using dig:

$ avahi-resolve --name ding-5cd80b3.local

$ dig +short -p 5353 @ ding-5cd80b3.local
;; Warning: ID mismatch: expected ID 60466, got 0

With neither can I do a reverse lookup:

$ avahi-resolve --address
Failed to resolve address '': Timeout reached

$ dig +short -p 5353 @ -x
;; connection timed out; no servers could be reached

The device that's advertising its name is a simple IoT device so I'm not surprised that it has very basic mDNS support (if uses the mDNS support provided by the ESP-IDF).

I've tried using verbose flags with both avahi-resolve and dig to see if either would give me some insight into what's happening but in neither case did I get any extra insight.

I'm guessing that ID mismatch means that dig actually is getting a response but is refusing to show it as it's interpreting this as a case of DNS spoofing while avahi-resolve is being more forgiving.

Is there any way to get dig to be more forgiving (I tried +besteffort) or any way I can see what's going on here, short of using Wireshark?

I'm working on Ubuntu and, as noted, the device in questions is using the ESP-IDF.

1 Answer 1


The problem does indeed seem to be with the underlying ESP-IDF library and its mDNS support.

It does not include the ID included in the original query in its response, it always just uses 0. Hence the dig error saying ID mismatch: expected ID 60466, got 0.

I've logged issue #5574 against the ESP-IDF to address this.

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.