0
我是一个托管代码的人,所以当我与非托管代码进行互操作时,它不能像广告中那样工作,我会变得不稳定。有人可以向我解释为什么当命令行nslookup
有效时,这会返回没有MX记录吗?MX记录查询失败
[DllImport("dnsapi", EntryPoint = "DnsQuery_W", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
private static extern int DnsQuery([MarshalAs(UnmanagedType.VBByRefStr)]ref string pszName, QueryTypes wType, QueryOptions options, int aipServers, ref IntPtr ppQueryResults, int pReserved);
string domain = "HomeTechnologySolutions.com";
int num1 = DnsQuery(ref domain, QueryTypes.DNS_TYPE_MX, QueryOptions.DNS_QUERY_BYPASS_CACHE, 0, ref ptr1, 0);
if (num1 != 0)
{
throw new Win32Exception(num1)
}
该回来的错误代码的意思是“没有找到指定的DNS查询记录”
在裤子的脚踢的是,这是第一个域我发现,未能做到这一点,但我告诉它发生“OFTEN”。 (没有人可以经常定义我还没有,但我已经是上)
无论如何,当我通过在命令提示符下执行NSLOOKUP,我回来:
> set type=mx
> hometechnologysolutions.com
Server: dhcp.removedtoprotectedtheguilty.com
Address: 10.0.0.9
hometechnologysolutions.com
primary name server = ns1.streetsimple.com
responsible mail addr = hostmaster.streetsimple.com
serial = 11
refresh = 900 (15 mins)
retry = 600 (10 mins)
expire = 86400 (1 day)
default TTL = 3600 (1 hour)
nope - 仍然没有由nslookup返回的MX记录... – Alnitak 2009-01-07 14:35:46