dr=net.createConnection(net.TCP, 0)
dr:dns("www.duckdns.org",function(conn,ip)
myip=ip
end)
conn=net.createConnection(net.TCP, 0)
conn:on("receive", function(conn, payload) print(payload) end)
conn:connect(80,myip)
conn:send("GET /update/your-domain-here/your-token-goes-here HTTP/1.1\r\n")
conn:send("Host: www.duckdns.org\r\n")
conn:send("Accept: */*\r\n")
conn:send("User-Agent: Mozilla/4.0 (compatible; esp8266 Lua; Windows NT 5.1)\r\n")
conn:send("\r\n")
Since conn:connect only seem to work with an IP address, the first part resolves the IP for duckdns.org, then creates the http request.
The IP address for the update is determined automatically by DuckDNS, you can also specify it manually as a 3rd argument to the http request if you like.