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 6915685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:30:22+00:00 2026-05-27T09:30:22+00:00

I can ping google from my local machine, but can anyone tell me why

  • 0

I can ping google from my local machine, but can anyone tell me why I might be getting “false” when I run the following in IRB on the same machine? Really frustrating as a ping is supposed to be the most simple network op and I just can’t get it to work!

1.9.2-p290 :001 > require "net/ping"
 => true 
1.9.2-p290 :003 > pinger = Net::Ping::External.new("http://www.google.com")
 => #<Net::Ping::External:0x88eac30 @host="http://www.google.com", @port=7, @timeout=5, @exception=nil, @warning=nil, @duration=nil> 
1.9.2-p290 :004 > pinger.ping
 => false 
1.9.2-p290 :005 > 
  • 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-05-27T09:30:22+00:00Added an answer on May 27, 2026 at 9:30 am

    The following is not a valid host/domain name (although it is a valid URL):

    http://www.google.com
    

    Thus, the DNS resolution will fail and, having no target IP, no ping can be sent.

    I’m sure you didn’t use that exact host for the command-line ping 🙂 As Gareth notes, doing so would look similar to:

    $ ping http://www.google.com
    ping: cannot resolve http://www.google.com: Unknown host

    A “normal ping”, which is being attempted here, and an “HTTP ping” are different. Contrast this usage with Net::Ping::HTTP, which does take a URL, for instance.

    Happy coding.


    (Either “google.com” or “www.google.com” would be suitable host names.)

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

Sidebar

Related Questions

I can ping using console app, but I want to ping from ASP.NET, the
When I play ping-pong with the Google OpenID provider, I can't get a friendly
I noticed that ping to Google DNS and to google.com from Serbia is about
Named instance of SSAS 2005. I can ping the machine by name, IP, and
I want to check the validity of my network connection. Can anyone please tell
my mac can ping others' computer which is xp,but they can't ping mine,I have
If I can ping my DB server, is my SQL Server connection guaranteed to
Can someone point me to some tutorial on how to set up a ping
I don't know why I can't connect anywhere with this code: (the ping returns
Can anyone let me know how can we change the value of kendo combobox

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.