dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: isp dns server address

  1. #1
    Join Date
    Jun 2002
    Location
    India
    Posts
    1

    isp dns server address

    hi

    I want to find the default dns server address / default gateway
    programatically.

    Is there a way to find out dns server ip address like ipconfig.

    Here is a sample output while running "ipconfig.exe /all" on my system
    (dial up connection)
    ___________________________________________________________

    D:\>ipconfig /all

    Windows IP Configuration

    Host Name . . . . . . . . . . . . : s
    Primary Dns Suffix . . . . . . . :
    Node Type . . . . . . . . . . . . : Unknown
    IP Routing Enabled. . . . . . . . : Yes
    WINS Proxy Enabled. . . . . . . . : Yes

    PPP adapter Dishnet:

    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : WAN (PPP/SLIP) Interface
    Physical Address. . . . . . . . . : 00-53-45-00-00-00
    Dhcp Enabled. . . . . . . . . . . : No
    IP Address. . . . . . . . . . . . : 202.9.156.173
    Subnet Mask . . . . . . . . . . . : 255.255.255.255
    Default Gateway . . . . . . . . . : 0.0.0.0
    DNS Servers . . . . . . . . . . . : 202.9.152.11
    202.9.145.6
    NetBIOS over Tcpip. . . . . . . . : Disabled
    ___________________________________________________________

    Now there it is written DNS servers.

    Is there a way to find out the dns servers. I have searched many sites
    but I can't find it out. Can you help.

    Shrishail Rana

  2. #2
    Join Date
    Aug 2001
    Location
    North Bend, WA
    Posts
    1,947
    Try typing DSN into the index of MSDN (or search msdn.microsoft.com.

    There is a ton of info about your question. In particular there is a Dns class with a method that gets the host name.

  3. #3
    Join Date
    Aug 2001
    Location
    North Bend, WA
    Posts
    1,947

    OOPS DNS

    Sorry I meant DNS not DSN. (Dyslexic Service Name)

  4. #4
    Join Date
    Mar 2019
    Posts
    1

    Re: isp dns server address

    Thanks for the information. It really saved me. Thank You

  5. #5
    Join Date
    Apr 2019
    Posts
    1

    Re: isp dns server address

    Thanks it was of great help.

  6. #6
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,764

    Re: isp dns server address

    Quote Originally Posted by billwilson3 View Post
    Try typing DSN into the index of MSDN (or search msdn.microsoft.com.

    There is a ton of info about your question. In particular there is a Dns class with a method that gets the host name.
    Note that the DNS class is part of .net and therefore only for use within C++/cli and not 'standard' C++.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.2.2)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)