Repository navigation
Client library
Code Snippets local dns = require('dns') -- import the libary
dns.setAddress('ADRESS') -- sets the DNS server address dns.setPort(404) --set the DNS Server port (default is 404)
dns.lookuo('NAME') -- look up a DNS and return the saved address as string. nil if there is no address false when the dns server could not be reached.
Sample:
` -- This prints the address or write if the addres exist or the server is down local dns = require('dns') -- import the libary
dns.setAddress('4d2e4c6c-b70b-42b0-85db-d3ea1b27b3c0') -- sets the DNS server address dns.setPort(42069) -- sets the DNS server port, the default is 42069
reply = dns.lookup('tutorial') -- look up a dns, in this case "tutorial" points to some address -- will return nil if there is no address corresponding to that dns -- will return false if the DNS server could not be reached -- will return string that contains the address for that DNS if everything went right
if reply == nil then print("Couldn't find that address.") elseif reply == false then print("Couldn't connect to DNS server.") else print("DNS Found! " .. reply) end`
WIKI
Programm Tutorials
Other Wikis(EXTERNEL)