Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By rickysocer
#52783 I am trying to query the IP of remote urls but can't figure out how to do it with the Arduino IDE.


In lua it's something like this:
Code: Select allsk=net.createConnection(net.TCP, 0)
sk:dns("www.domain.com",function(conn,ip) print(ip) end)
sk = nil

In shell its
Code: Select alldig www.domain.com

that returns:
Code: Select all;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24980
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.domain.com.         IN   A

;; ANSWER SECTION:
www.domain.com.      30   IN   CNAME   domain.com.
domain.com.      30   IN   A   169.45.92.196


How do i do the same thing using the Arduino sketch?