Code for looking up NSAP addresses
Rui Prior
rprior at inescn.pt
Wed Nov 3 19:53:25 UTC 1999
Hello all.
I need to perform (direct and reverse) lookups of NSAP addresses.
I am using bind 8.2 (version that comes with RedHat 6.0) and have already
configured it (and tested using nslookup and dig), and it is working.
But now I need to implement some code to automate the process (much like
gethostbyname() and gethostbyaddr(), only for NSAPs), but as I have
absolutely no experience with DNS I'm a bit lost.
What I need is:
1) For direct lookup:
- Set class to IN
- Set type to NSAP
- Set the nameserver to the default nameserver of the system (eventually,
looking up all system configured nameservers in /etc/resolv.conf)
- Query the server the usual way (using the name itself, the name
appended with default domain, the name appended with additional domains
specified in the search line in /etc/resolv.conf) and parse the NSAP into a
string of characters.
2) For reverse lookup:
- Set class to IN
- Set type to PTR
- Set domain to nsap.int
- Query using the NSAP and parse the name into a string.
I started looking at the source code for "dig", but it's a little confusing.
I wonder if someone has a simpler piece of code I can use as a reference or
modify to do this.
Thanks for helping.
Rui Prior
More information about the bind-users
mailing list