473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to resolve MX record given a domain name

Hi

I'm having problem resolving DNS records of a domain using C#. What I want
to do is an exact replica of this command

nslookup.exe -type=MX [domainname] [dns-ip]

i.e I need to resolve the MX record of a domain name using a certain Dns
server. I tried calling unmanaged code as given below and it succeeds well,
but I can't mention, which DNS server to use while resolving the MX record
of that domain. Is there any such possibility using C#.

[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);
Regards

Usman
Apr 12 '07 #1
1 6516
Hi Usman,
i.e I need to resolve the MX record of a domain name using a certain Dns
server.
This link looks like it could solve your problem:

http://www.codeproject.com/cs/intern...okupdotnet.asp

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
ja***@removethis.dystopia.fi
http://www.saunalahti.fi/janij/
Apr 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: wqhdebian | last post by:
It was said the ORA-02085 error result from the mismatch of database name and database link name ,and setting glabal_names=false can resolve . but I want to try the other solution,let global_names...
5
by: Derek Cooper | last post by:
I hope you can help me. I posted this in the microsoft sql server newsgroup a few days ago and got no response so I thought I'd try here. If I can provide any clarification I'll be glad to do so....
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
2
by: Rob Levine | last post by:
Hi All, This is a cut down version of a post from earlier entitled "Name resolution in .Net". Apologies, for the repeat, but I think the first post was too verbose (it came from a blog article...
2
by: Wayne | last post by:
This is a copy of a message I previously posted in a Microsoft Access Newsgroup, but it was suggested to me that my problem is ASP related and not Access, and hence I'm posting in this newsgroup now...
0
by: Durai | last post by:
Hello All, I built postgresql on HPUX IPF(11.22) platform. It works fine. But I have warning message "could not resolve "localhost": host nor service provided, or not known" when I start the...
7
by: kvnsdr | last post by:
I can type an IP address and receive Internet domain name and my workstation name however no other IPs of computers on our internal network will resolve to a thier machine name only to the same IP...
2
Plater
by: Plater | last post by:
Here my situation: My company network has 2 connections externally ( A T1 and buisness cable). Each have static IP addresses. We have a dual WAN router in place handling them. that part seems...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.