What is the easiest way to get a domain IP address?

We are developing a built-in application that works on a stand-alone device connected to GPRS (there is no operating system there). We are trying to get the IP address of a domain name. I think we should use some public DNS services like Google DNS ( 8.8.8.8). The question is, what is the simplest request we need to send 8.8.8.8:53to get the IP address of our domain?

Again, we cannot use libresolveor any other similar libraries. We will make a simple TCP connection to the 53Google DNS port and we will format our request ourselves.

I myself tried to understand RFC1053 , but could not. Too many words:)

+3
source share
1 answer

I'm not a DNS specialist, but I thought DNS usually uses UDP rather than TCP?

In any case, here is a link to a page that describes communication using fewer words that can be understood more easily than the RFC itself.

In addition, even if you cannot use the libresolve library, can you see the open source version of this library and use the code from one of them (provided that the license is compatible with your work). Here is one from Apple that I found through google.

0
source

Source: https://habr.com/ru/post/1780404/


All Articles