How to trace the user's country using ip address he is using? - ip

i want to know how to trace someone accessing my website using his/her ip-address.
because if there's a code then i want it to insert in my website to deny the users from some countries to access my website.

You can use the API mentioned below to get ip address details.
This API is free.
https://www.iplocate.io/api/lookup/8.8.8.8
Where 8.8.8.8 is the ip address and you can replace it according to your user IP address.
It will result like
{"ip":"8.8.8.8","country":"United States","country_code":"US","city":null,"continent":"North America","latitude":37.751,"longitude":-97.822,"time_zone":"America/Chicago","postal_code":null,"org":"Google LLC","asn":"AS15169","subdivision":null,"subdivision2":null}

Related

User can't see server

The user is reporting the issue has an IP address of 10.10.15.67/20. The server has an IP address of 10.10.16.1/20. The user's machine has an IP address of 10.10.25.197/20. Can anyone explain to me based on this why he can't get to the file? This users has full permissions.
The first IP address belongs to network 10.10.15. The other two, to 10.19.16.
Do the first machine not being in the same subnet cannot talk to the two others. Use ping to confirm that.
You can use the subnet calculator here: https://www.calculator.net/ip-subnet-calculator.html

Is it possible to get the website url from a destination IP?

I've been setting up data visualizations for my Fortigate device, and logs from the device just give the destination IP of the app the user is accessing. I want to know if it is possible to know the website url of each destination ip supplied by the raw logs of the device. Thank you
You can get the hostnames for the given IP address using the reverse IP lookup tools.
Looking up for URLS is something not supported off the shelf, however you can do further some lookups once you know the hostname.

Is it possible to access a Firebase hosting site via an IP address?

I have a hardcoded DDNS URL in an application that I can no longer modify the code for. It currently points to a server using its IP address and I'm trying to move over to Firebase.
My problem is that I need to update the DDNS URL with an IP address but I've only got a hosting URL like https://myapp-123q4.firebaseapp.com/.
My understanding is (from this Google Groups post) that because the entire system is shared, there are some specific IP addresses that can be used. Is there any way to access my own firebase hosting URL using an IP address?
(Pinging my firebase URL gave me the IP 151.101.1.195 which is one of the ones mentioned on the above linked post.)
You should not depend on direct IP addresses for accessing Firebase Hosting. There are simply not enough IPv4 addresses available for everyone to have exclusive access to one. You need to use the host name in the HTTP request so that the server can route the request to the correct content.

get client ip and client location in symfony2

I need the client IP address to find the client location so that I could list the details of that area to he client. I used this code to find the IP address.
$this->container->get('request')->getClientIp();
But I'm getting the IP as 127.0.0.1.
How can I get the client IP address? Can someone give me a complete working code?
It's 127.0.0.1 because your server is installed on your machine (I guess).
But $request->getClientIp() is the right way to get the user ip.
For the geolocation, I suggest you to take a look at the geocoder library and his bundle.

how to get mac address from ip address from client site in asp.net?

i want to store details of visitor in site like
ip and mac address
i got ip address of client
but how can i get mca address of client ?
Simple answer: you can't. The MAC address is never transmitted. The best you can hope is to get the IP but remember that this IP could be the one of a proxy server situated anywhere in the world if the user configured some proxy to access the internet.
If your website has been compromised you will have to contact the authorities in order to attempt to catch the person who did it. In most countries regular citizens do not have the power or authority to request the type of information you need from ISPs.

Resources