Geo Location for Internal Networks - maxmind

I am currently trying to add private network addresses to .mmdb file.
Is there any way to add private network related data into GeoLite2 MMDB file?

If you refer to Private IP address range, then there is no way to geolocate it because the range can been used in any location in LAN.

Related

domain and rDNS data not matching

When I search something on google.com, I see interaction with the following IP address: 172.217.7.132
But when I attempt to reverse lookup the ip address, I get iad30s08-in-f132.1e100.net. and iad30s08-in-f4.1e100.net., not google.com.
What do I need to do in order to correctly identify that this IP address is resolved by google.com.
EDIT
Clarifying the question: My problem is not specific to google.com. I want to programmatically/logically arrive at google.com because that's what my browser requested for.
Same problem exists in the case of amazon: The IP address it resolves to, on reverseDNS gives me: server-13-32-167-140.sea19.r.cloudfront.net. instead of amazon.com
Code for performing reverse lookup:
In [1]: def reverse_lookup(ip_address):
...: from dns import reversename, resolver
...: domain_address = reversename.from_address(ip_address)
...: return [answer.to_text() for answer in resolver.query(domain_address, "PTR")]
As others have mentioned, 1e100.net does, in fact, belong to google. Their reverse DNS is going to resolve to whatever they want it to resolve to, and there's not much you can do about that.
Depending on your requirements, another alternative may be using a geolocation database to gather more information about an IP. You can find a demo of this here:
https://www.maxmind.com/en/geoip-demo
(enter your example address 172.217.7.132 in the form)
MaxMind has various products (some free, some commercial), so one of them may fit your needs of being able to look up this info programatically.
A different possible solution would be to get access to a WHOIS API, such as:
https://hexillion.com/whois
Example results:
https://hexillion.com/samples/WhoisXML/?query=172.217.7.132&_accept=application%2Fvnd.hexillion.whois-v2%2Bjson
https://support.google.com/faqs/answer/174717
1e100.net is a Google-owned domain name used to identify the servers in our network.
Following standard industry practice, we make sure each IP address has a corresponding hostname. In October 2009, we started using a single domain name to identify our servers across all Google products, rather than use different product domains such as youtube.com, blogger.com, and google.com.
Typically, you will get a 1e100.net result when you do a reverse lookup on one of their IPs. Consider it as good as a google.com result would be - you've verified that the IP is controlled by Google if you see it.
One exception to this is the Googlebot crawler, which may return google.com or googlebot.com results. (I would expect this to eventually get moved over to 1e100.net in the future.)

Create subdomain for each user dynamically (in a shared server)

i want to create subdomains automatically for each user, like: user1.example.com, user2.example.com, user3.example.com .....
First i created an "A record" like *.example.com IN A 1.2.3.4. second i learned i need to create a virtual hosting. However i am on a shared server which means i don't have access to httpd.conf file. if i type jjj.example.com it directly goes to jjj.example.com/cgi-sys/defaultwebpage.cgi.
What should i do after that point? Can i create what i want on a shared server? Should i give up? Thanks.
Mhh - what do you want exactly?
Create different subdomains which shall be handled on different
ip-Adresses (by different parts of Software)
Adjust yout (Web-)Server zu deliver user- (=subdomain-) specific contents?

How to Find Specific Network Computer Information

I did lookup on StackOverflow and Googled, but did not find any code that can help me on this.
Request help here on this please.
We have a network with many computers. I would want to enter the name of a computer and should be able to get back the OSArchitecture, IPAddress and Full Computer Name.
I want to achieve this using VB.net
I tried using the "My.Computer.Name" and related options, but it gives me details of my computer only, I would to query the details of a specific computer on the network.
Note: This is a domain controlled network, not requesting for Home Workgroup
Getting the IP addresses is straight forward:
Dim ips As IPAddress[]
ips = Dns.GetHostAddresses(Dns.GetHostName())
The other information you could get through WMI

How to isolate an IP address in Visual Basic?

In Visual Basic, I'm making a program that will send me an email with the IP address of my laptop (just for fun).
The only way that I can think of getting my external IP address is to look at the source for ipchicken.com
It's easy to pull the text down but how do I isolate my IP address?
Note: The IP Address in the source is around line 36, but that is subject to change. Here's the link for all Chrome users: view-source:http://ipchicken.com/
Use http://icanhazip.com/
It returns just the string with IP.
Maybe you can check what is done over here : http://htmlagilitypack.codeplex.com/
If you want to know how to reach a node inside the HTML, use your favorite browser, right click on the IP adress on the website -> inspect element -> copy CSS path (or XPath path)
Here is a sample you might need http://htmlagilitypack.codeplex.com/SourceControl/latest#Trunk/Samples/GetDocLinks/GetDocLinks.cs
I found the answer to my own question:
You can use this RegEx to look for the pattern of an IP:
\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
The one above searches for the pattern xxx.xxx.xxx.xxx where "xxx" is a number ranging from 0 to 255.
You can find a tutorial here.

static or dynamic ips

I run this site and I approve access for a section of the site for people. I only want to approve static ips. If i have a bunch of IPs how do I find out if they are static or not? I can do the remaining parts but there is probably some function in the socket library or something that lets me script the part to find if the users are using static or dynamic IP.
thanks !
Php/Js would work too.
There is no way to inherently tell if an IP address is static or dynamically assigned. Based on the hostname that the IPs resolve to, you could probably make a guess as to whether they are static or not, but there is nothing definitive to facilitate this.
You could use the socket module to resolve the IPs to hostnames and flag them as "static" or "dynamic" based on some kind of "best guess" algorithm, but it would be only that: a best guess.
Here is an example using a random Verizon FiOS IP address. This assumes that any IP starting with "pool" is dynamically assigned.
>>> hostname = socket.gethostbyaddr('71.243.222.111')[0]
>>> if 'pool' in hostname:
... print hostname, 'is dynamic'
...
pool-71-243-222-111.lsanca.fios.verizon.net is dynamic
You're going to have a very tough time determining all of the various naming conventions and this would in no way be a complete solution.
You might want to ask yourself what kind of problem you're trying to solve first, and whether filtering access by IP address is providing the kind of verification you need.
I'd use a pragmatic solution: New accounts have a trial phase of a few days. After that they can only log in from the same IP used to sign up. If they still have that same IP it's most likely static.
Well, you don't have a problem, do you? If they ask for access from IP X, you give them access from IP X. If it turns out that it was dynamic and they switch, they no longer have access. In practice, no access from dynamic IPs :)
Seriously though, the authority on IP assignment type is the host from which the user is accessing. Thus, you need to ask the user what it says in his/her config.