Comments (8)
How dare it say such lies.
I'm looking into this problem now.
from catphish.
@robindimyan Ooooh, so. This is actually quite interesting!
Facebook seems to have registered www-facebook.com
but there's no actual DNS related things to actually resolv that address. Meaning, they can own that address but obviously don't have to force any sort of resolution of the address to an IP.
No Dice
Which means when, as catphish is currently implemented, there's no secondary check for validity.
require 'resolv'
Resolv.getaddress "www-facebook.com"
Will error out like so:
Resolv::ResolvError: no address for www-facebook.com
Whois Tell Us Who Is Plz
But, if we ran a whois on that address:
> whois www-facebook.com
We will see the whois information for facebook.
Ping'em
If we ping the address, just cuz:
> ping www-facebook.com
We will see:
ping: cannot resolve www-facebook.com: Unknown host
from catphish.
Well, I guess it's not that interesting. But, it means something.
How To Fix
Honestly, after you pointing out this issue, I am seeing that catphish is using the whois
gem -- but, like, not in the code at all. CORRECTION: It's only being used for puny code resolutions. Perhaps a whois call could be made for all of the failed resolv methods that error out.
OR this could be implemented as a second option. But, there's also the case of why it's still saying it's available for some reason. CORRECTION: Because it doesn't work properly, obviously. Which I'll look into now.
from catphish.
I wonder if the resolv option should just always be a whois option. Or to separate the two functionalities into their own command-line arguments. There's lots of options with that.
from catphish.
Yay Redundancies
Since this is just one of those fun teaching moments: let's do that.
Catphish, as it is currently implemented, has the following gems:
require 'resolv'
require 'getoptlong'
require 'simpleidn'
require 'whois'
require 'whois-parser'
Let's narrow in on just whois
and whois-parser
for a second.
This is how that happens in, let's say, a pry REPL:
[1] pry(main)> require 'whois'
=> true
[2] pry(main)> require 'whois-parser'
=> true
Now, what if we reversed that order?
[1] pry(main)> require 'whois-parser'
=> true
[2] pry(main)> require 'whois'
=> false
Redundant Gems are Fun
You actually could just require the whois-parser
gem instead of requiring the whois
gem and the whois-parser
gem. This is because the whois-parser
gem is actually also requiring the whois
gem for you. Because it's actually extending it's functionality (if I'm not mistaken about the extending part).
So, anyway.
Still working on fixing some stuff.
from catphish.
Whois Parser Makes Me Feels Better
require 'whois-parser'
# This is almost kinda, like, ugly tho, but works:
Whois.whois("www-facebook.com").parser.available?
# => false
I'm pretty sure just relying on the whois information is going to be more reliable.
So, perhaps if there was a resolv command-line option. It could be for speed, maybe. Depends on the speed of getting/parsing whois information. There's some design thoughts to be had for sure. And benchmarks might help.
from catphish.
The problem with 'whois' its limited to <= 200 - 300 queries before it gets timeout, which is not going to work for a large number of domain queries. On the other hand, 'resolve' gives a faster response and can query a large number domains without any issues. However, like in this case 'www-facebook.com'', it gives a false positive because the domain can't be resolved, which is not the case for 'whois'. We are aware of this issue and it will be addressed soon in the near future. Any suggestions would be appreciated.
from catphish.
What about dig
for NS entries on NIC?
from catphish.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catphish.