Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ip-to-hosting
Advanced tools
This package allows you to check whether an IP address belongs to a hosting provider or not. In case the IP address can be successfully linked to a hosting provider (datacenter), this module will return the meta information for the hosting provider.
This package allows you to check whether an IP address belongs to a hosting/cloud provider. In case the IP belongs to a hosting provider (datacenter), this module will return the meta information for the hosting provider.
Currently, there are more than 180,000 IP ranges from more than 4,400 hosting providers in the database. Learn more, by reading the documentation.
You can both use this package from Node.js and in the browser with vanilla JavaScript.
npm install ip-to-hosting
If you want to clone the repository directly from GitHub instead:
git clone git@github.com:ipapi-is/ip_to_hosting.git
If you want to lookup the following IP addresses:
const { ipToHosting } = require('ip-to-hosting');
const ipAddresses = [
'144.168.164.55',
'167.99.241.66',
'97.107.129.77',
'85.10.199.76',
];
for (let ip of ipAddresses) {
ipToHosting(ip).then(function (isHosting) {
console.log(`${ip} isHosting:`);
console.log(isHosting);
});
}
which yields:
85.10.199.76 isHosting:
{
datacenter: 'Hetzner Online GmbH',
domain: 'www.hetzner.com',
network: '85.10.192.0 - 85.10.207.255'
}
167.99.241.66 isHosting:
{
datacenter: 'DigitalOcean',
code: '60341',
city: 'Frankfurt',
state: 'DE-HE',
country: 'DE',
network: '167.99.240.0/20'
}
144.168.164.55 isHosting:
{
datacenter: 'ServerMania Inc.',
domain: 'https://www.servermania.com/',
network: '144.168.128.0-144.168.255.255'
}
97.107.129.77 isHosting:
{
datacenter: 'Linode',
domain: 'https://www.linode.com/',
network: '97.107.128.0-97.107.143.255'
}
If the IP address belongs to a datacenter/hosting provider, the API response will return an object with the following required attributes:
datacenter
- string
- to which datacenter the IP address belongs. For a full list of datacenters, check the ipapi.is/json/info endpoint. In this case, the datacenter's name is B2 Net Solutions Inc.
domain
- string
- The domain name of the companynetwork
- string
- the network this IP address belongs to (In the above case: 144.168.128.0 - 144.168.255.255
)With some datacenter providers, more meta data is available. Consult the API documentation page in order to learn more.
Most IP's don't belong to a hosting provider. In those cases, the response will be null
.
Copy the browser JavaScript bundle to your preferred location. After installing the module with
npm install ip-to-hosting
you can find the minified JavaScript here: node_modules/ip-to-hosting/dist/ipToHosting.min.js
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>IP to Hosting Example Browser</title>
<meta name="description" content="IP to Hosting Example">
<meta name="author" content="ipapi.is">
</head>
<body>
<pre id="hosting"></pre>
<script type="text/javascript" src="dist/ipToHosting.min.js"></script>
<script type="text/javascript">
ipToHosting('43.33.44.11').then((res) => {
document.getElementById('hosting').innerText = JSON.stringify(res, null, 2);
});
</script>
</body>
</html>
This package uses the ipapi.is API in order to avoid shipping a huge database in the npm module. If you have a large volume of IP addresses to lookup, you can download the full & free Hosting Provider Database.
GitHub mirror of the database: Hosting Provider Database Mirror
FAQs
This package allows you to check whether an IP address belongs to a hosting provider or not. In case the IP address can be successfully linked to a hosting provider (datacenter), this module will return the meta information for the hosting provider.
The npm package ip-to-hosting receives a total of 20 weekly downloads. As such, ip-to-hosting popularity was classified as not popular.
We found that ip-to-hosting demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.