Originally posted by: Yaoer
I build a recursive loop.
BOOL GetMX(char * maildomain, char * szMX, char * szDNS = "a.root-servers.net")
//"a.root-servers.net" is the root of internet, haha, i get this from MS nslookup.
{
send MX query to szDNS
if can get MX from response of szDNS
{
szMX = resolve response of szDNS;
return TURE;
}
else
{
szDNS = get forward DNS from szDNS;(resolve response of szDNS)
if(szDNS == NULL)
return FALSE;
return GetMX(maildomian, szMX, szDNS)
}
}
but something can be developed in advance, as you know, when get MX from szDNS,
the response will return a forward DNS servers list. in my code, i just get the first DNS of this list.
Originally posted by: Alperovich Eugene
Help me,please !!!
Does someone know how to write DNS resolver vor MX records running under Win98?
Recently i found such a program writen on delphi(but not source code)and it really works under Win98!!!
If someone know the answer,please write.
I will be looking forward to any reply(my e-mail alpeugene@hotmail.com)
Originally posted by: Richard
Now its changed to use the dns api does this now mean that it wont run on windows 98 anymore?
ReplyOriginally posted by: Thomas Heike
When I entered a DNS servers IP address, the parameter was ignored. I found this block in the sourccode (simplednsclient.cpp / CSimpleDNSClient::Resolve(...)):
/* WARNING: All the code below is useless/Doesn't work
while (pServer != NULL) {
But why does it not work?
Great code but ...
****
Apparently, the 4th parameter to DnsQuery function (see below) is always rejected
with error code 87 (invalid parameter).
When you pass the NULL pointer, the function automatically finds the DNS servers
as defin on the local machine. For now, there's no need to do more.
Unfortunatly, if the calling application wants to use a specific DNS server, the
component won't use this parameter.
szServerAddress = oServerList.GetNext(pServer);
// Convert dotted notation into address (4 bytes)
// Store it in configuration (memory)
pSrvList->AddrCount = 1;
pSrvList->AddrArray[0] = inet_addr(szServerAddress);
bNoServer = FALSE;
// TODO: store all servers in IP4_ARRAY (how??? there's only one element is array!)
// For now, exit loop after 1st server
break;
}
if (bNoServer) {
CString szErrorMessage = "Invalid DNS server addresses \"";
szErrorMessage+=m_szServerAddresses;
szErrorMessage+="\": ";
SetError(szErrorMessage, ERROR_INVALID_PARAMETER);
return(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER));
}
*/
The error's cause isn't the serverlist but the query options ... if you want to use a custom DNS server list you have to specify DNS_QUERY_BYPASS_CACHE.
Replace the line
DWORD fOptions = DNS_QUERY_STANDARD;
with
DWORD fOptions = DNS_QUERY_BYPASS_CACHE;
and the code will work.
Originally posted by: Oren Farber
Do yoo have an example and code for DNS server
Thanks,
Oren Farber
Originally posted by: Shaz
i want to get mail server names against a domain. i call the function GetEmailServers("hotmail.com",returnNames) but nothing is returned. please guid me how should i execute this function.
ReplyOriginally posted by: Igor Proskuriakov
Hi,
Please note that your implementatin of GetWindowsDNSServerAddress assumes that DHCP is not enabled. If is is enabled than DhcpNameServer shall be used instead of NameServer and DhcpDomain instead of Domain.
The rest is excellent work!
Thanks much,
Regards,
Igor
Originally posted by: Johan
Nothing works
ReplyOriginally posted by: Joshua Xu
Thanks,
The code is great and can get smtp server from DNS server.
Is there anyway that we can get a pop3 server from DNS server or somewhere else?
Joshua
Originally posted by: Kelvin Smith
Hi emmanual,
Excellent article and code. Does it run on Windows NT Server 4.0 SP5?
I'm having a problem registering the DLL, keep getting an
"OleMainThreadWndName - Regsvr32.exe - Ordinal not found. The ordinal 58
could not be located in the dynamic link library ALT DLL." I think its has
something to do with the Visual C build or the Visual C DLLs.
Hi gurus
My Simple DNS Resolver dll works fine on my development server but it gives me the following error on the deployment server
"Retrieving the COM class factory for component with CLSID {B91D4568-D492-11D3-8021-0010E3B966CE} failed due to the following error: 80040154."
What is the problem? Please help!!
Reply