- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- hosts list with DNS (in C)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2002 04:55 AM
06-18-2002 04:55 AM
hosts list with DNS (in C)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2002 05:01 AM
06-18-2002 05:01 AM
Re: hosts list with DNS (in C)
You can use the
gethostbyname
gethostbyaddr
functions.
You can use the nsquery function to determine which name service returned the data from above functions
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2002 05:10 AM
06-18-2002 05:10 AM
Re: hosts list with DNS (in C)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2002 09:57 AM
06-18-2002 09:57 AM
Re: hosts list with DNS (in C)
to your system. You do NOT want to list them all!
Perhaps you just want to enumerate the hosts in
your DNS domain (".mycompany.com" or whatever),
or on your LAN. I don't know how to do the former.
The latter should be relatively easy to do, but your
network admin will probably not be very happy with
it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2002 12:49 AM
06-19-2002 12:49 AM
Re: hosts list with DNS (in C)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2002 10:35 AM
06-19-2002 10:35 AM
Re: hosts list with DNS (in C)
you're going to have to speak directly to DNS server.
See the man pages for resolver(4), resolver(3N), named(1m),
and the appropriate RFCs.
On the other hand, it appears that the nslookup command
is able to do what you want. Perhaps you can
system("nslookup ...") and parse the results, or maybe
you can get the source code for the GNU version and see
how they do it.
Example:
unix% nslookup
Default Name Server: dns.mycompany.com
Address: 123.456.789.1
> ls mycompany.com
foo 123.456.789.2
bar 123.456.789.3
baz 123.456.789.4
quux 123.456.789.5
etc.
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2002 12:36 PM
06-19-2002 12:36 PM
Re: hosts list with DNS (in C)
I have an application calles hummingbird exceed on my workstation. There is a utility that comes with this application. The utility is called nslookup. This utility can be configured to do nslookup using a dns server. There is an option to get the list of all the hosts configured into the DNS for a particular domain.
This is a licenced application and is a $$$ product.
http://www.hummingbird.com/products/nc/exceed/
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 02:55 PM
06-21-2002 02:55 PM
Re: hosts list with DNS (in C)
For example :
> ls -t sub.rose.hp.com
[dyna.sub.rose.hp.com]
$ORIGIN sub.rose.hp.com.
burfurd 1D IN A 192.168.20.85
dyna 1D IN A 192.168.20.5
gateway 1D IN A 192.168.20.1
localhost 1D IN A 127.0.0.1
moo 1D IN A 192.168.20.86
Of course, this pre-supposes you know the domain you want to dump.
If you want to do it programmatically, try posting Mr DNS at http://www.acmebw.com. Cricket and some old hp hostmasters still hang out there, and are very helpful. There is even a searchable database.