Possible Duplicate:
Can I get the names of all the domains a Linux computer is connected to in C++?
Hi
My Linux machine is connected (by external NICs) to 2 external domains.
I want to discover in my linux c++ application all the names of domains my machine is connected to.
how can I get all these names?
BTW: if getnameinfo can do it – it doesn’t work for me. please suggest another answer.
PLEASE ATTACH CODE EXAMPLE
10x!
You can get a list of domains the DNS resolver is going to search from
/etc/resolv.confIn the above there is
searchdirective with a list of domains to search. So, when you try to resolve hostname X, it is going to search for X, X.anon.local and X.int.anon.co.uk.