[Mono-list] How to get the DNS server address?

William Huskey william.huskey at gmail.com
Fri Nov 28 12:51:25 EST 2008


why not just parse the /etc/resolv.conf file... this would give you the DNS
address, just pull the first one as its the primary
a quick search on the web pulled this regex for ipaddress (ipv4)s
http://www.windowsdevcenter.com/pub/a/oreilly/windows/news/csharp_0101.html

string t11 = "55.54.53.52";
string p11 = "^" +
  @"([01]?\d\d|2[0-4]\d|25[0-5])\." +
  @"([01]?\d\d|2[0-4]\d|25[0-5])\." +
  @"([01]?\d\d|2[0-4]\d|25[0-5])\." +
  @"([01]?\d\d|2[0-4]\d|25[0-5])" +
  "$";
Match m11 = Regex.Match(t11, p11);


On Fri, Nov 28, 2008 at 9:36 AM, Petit Eric <surfzoid at gmail.com> wrote:

> 2008/11/28 chenxing <cxcxcxcx at gmail.com>:
> >
> >
> > Petit Eric wrote:
> >>
> >> Dns class havent got something like that ?
> >>
> >
> > No. I haven't found one yet. I am also curious about that. My solution to
> it
> > is to implement a DNS Client, that can be done with the help of open
> source
> > code on the Internet. But the address of the DNS Server remains a
> problem.
> I'm not sur to understand, you try to get the dns Ip adress registered
> on the machine or to have the name associted to an IP.
> Perhap's this google search can help yu :
>
> http://www.google.fr/search?hl=fr&client=firefox-a&rls=org.mozilla%3Afr%3Aofficial&hs=x6R&q=host+name+C%23&btnG=Rechercher&meta=
> > --
> > View this message in context:
> http://www.nabble.com/How-to-get-the-DNS-server-address--tp20733912p20737989.html
> > Sent from the Mono - General mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > Mono-list maillist  -  Mono-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> >
>
>
>
> --
>
> Cordially.
>
> Small Eric Quotations of the days:
> ---------------------------------------------------------------------------
> If one day one reproaches you that your work is not a work of
> professional, say you that:
> Amateurs built the arch of Noah, and professionals the Titanic.
> ---------------------------------------------------------------------------
>
> Few people are done for independence, it is the privilege of the powerful
> ones.
> ---------------------------------------------------------------------------
>
> No key was wounded during the drafting of this message.
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>



-- 
William S. Huskey

UNIX Systems Engineer

Maritime Systems Solutions Division

SAIC

Tel: 425-267-5643

Email: huskeyw at saic.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20081128/a5172661/attachment.html 


More information about the Mono-list mailing list