How can I send queries to DNS server? For example, how to ask for MX for mydomain.com?
Although I've used the ESP32 for a lot of WiFi stuff, I've not tried converting hostname to IP address. It seems that Wifi.hostbyname() might be what you are looking for, at least according to this topic
But I need to query for other records too, not just A record.
I misunderstood your original question. I can't help, sorry.
You can send DNS packets via UDP to a DNS server. The packet format is fiddly: network order, with a name-compression scheme.
MX, like most of these records, doesn't change that often. Would be easier just to use dig to get the answer. Unless of course, you need to automate it.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.