Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8887313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:46:37+00:00 2026-06-14T21:46:37+00:00

The function Dns.GetHostEntry doesn’t handle ipaddresses as strings e.g. 127.0.0.1 but if I pass

  • 0

The function Dns.GetHostEntry doesn’t handle ipaddresses as strings e.g. 127.0.0.1 but if I pass google.de as a parameter it works quite well.

Am I doing something wrong ?

public static Socket connSock(string Server, int Port)
{
        Socket s = null;            
        IPHostEntry ipHE = Dns.GetHostEntry(Server);
        //IPAddress[] ipA = null;
        IPEndPoint ipE = null;

        foreach (IPAddress address in ipHE.AddressList)
        {

            ipE = new IPEndPoint(address, Port);
            Socket tempSocket = new Socket(ipE.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            tempSocket.Connect(ipE);

            if (tempSocket.Connected)
            {
                s = tempSocket;
                break;
            }
            else
            {
                continue;
            }
        }

        return s;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:46:38+00:00Added an answer on June 14, 2026 at 9:46 pm

    This could mean you’re system is unable to get the host entry. This occurs (for instance) when there’s no PTR record defined for the given IP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

nslookup.exe www.google.com 127.0.0.1 This command can resolve using DNS server 127.0.0.1, it's impossible to
I'm trying to get dns records of a domain through dns_get_record() but the function
function LolClass(){ this.init = function(){ button_a.bind(tap, function(){ this.refreshFields(); // doesn't work //refreshFields(); // doesn't
I have to call recordCount function to get the count of recordset. But once
PHP's gethostbyname() function doesn't seem to be configurable as far as timeouts are concerned.
I have a symfony project which, because of DNS issues, is http://<project-name>/ locally, but
I'm using gethostbyname function for DNS and IP addresses checking. However, it does not
I have this function array_diff(\@DNs, \@prev_DNs); which must take array references as arguments. The
I'm studying http://www.php.net/manual/en/function.dns-get-record.php and there seems to be no option to set a custom
I'm very new to Node.js and I'm having an issue using node.dns.resolveNs function. Some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.