Wanted, no, make that Needed: DNS Examples

Started by CaveGuy, October 03, 2003, 08:57:57 AM

Previous topic - Next topic

CaveGuy

Currently we have a smtp client, pop client, and httpd server example.



A DNS client example would be very helpfull. It would be a big start to

the creation of a http client/browser :)



Wish list:

1 Given a domain.name it should return an ip address.

2 Given an IP address it should return the Reverse lookup.

3 Given an domain.name a list of "MX" records would be nice.

4 Given an domain.name a list of "any or all" rececords would be great.



Does anyone have an example I can start with, or want to tackel this one ?



I will have to dig up a copy of O'relly's Bind and DNS book :)
Bob the Caveguy aka Lord High Fixer.

Lutz

#1
> 1 Given a domain.name it should return an ip address.

> 2 Given an IP address it should return the Reverse lookup.



it does these already:



(net-lookup "nuevatec.com")  =>  "128.121.96.1"

(net-lookup ""128.121.96.1") =>  "nuevatec.com"



These are based on gethostbyname() and gethostbyaddr() 'C' functions. These functions are not always inverse, i.e. "nuevatec.com" and "newlisp.org" point to the same IP address, but the reverse always gives only "nuevatec.com". I think full DNS lookup would perhaps give more info.



Since 7.1.6 we also can talk the UDP protocol with 'net-send-udp' and 'net-receive-udp', which can be used to talk to DNS servers (which use the UDP protocol), but I do not know enough about the details of the DNS/BIND protocol. I imagine that those functions could be used to implement points (3) and (4).



Also, 'get-url'  already gets a web-page or the header -info when you use the "header' option. So you only have to write the code to render the page (and be busy for the next year or so).



BTW, just finished a 'uncrashable safe' format function, which does type checking on arguments and checks the format string for syntax correctness. This goes into the developmet directory next week (still needs a lot of testing).



Lutz