<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eli Krizevski</title>
    <description>The latest articles on DEV Community by Eli Krizevski (@lateraluslab).</description>
    <link>https://dev.to/lateraluslab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F551729%2Fa5ce97e4-06d7-4cb1-b777-f32e103896d4.jpg</url>
      <title>DEV Community: Eli Krizevski</title>
      <link>https://dev.to/lateraluslab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lateraluslab"/>
    <language>en</language>
    <item>
      <title>How we built a "What is my ISP?" lookup that never logs your IP</title>
      <dc:creator>Eli Krizevski</dc:creator>
      <pubDate>Wed, 18 Nov 2026 21:57:28 +0000</pubDate>
      <link>https://dev.to/lateraluslab/how-we-built-a-what-is-my-isp-lookup-that-never-logs-your-ip-5enl</link>
      <guid>https://dev.to/lateraluslab/how-we-built-a-what-is-my-isp-lookup-that-never-logs-your-ip-5enl</guid>
      <description>&lt;p&gt;"What is my ISP?" sounds like a simple question. Most tools that answer it send your IP address to a paid&lt;br&gt;
lookup service, log it, or both. For a VPN comparison site, that felt wrong: a privacy tool shouldn't leak your&lt;br&gt;
address to answer a question about it.&lt;/p&gt;

&lt;p&gt;So we built our own and open-sourced it: &lt;strong&gt;&lt;a href="https://github.com/elidotexe/comparevpn-tools" rel="noopener noreferrer"&gt;CompareVPN Tools&lt;/a&gt;&lt;/strong&gt;,&lt;br&gt;
a small ASP.NET Core API that powers the ISP checker on &lt;a href="https://comparevpn.co" rel="noopener noreferrer"&gt;CompareVPN&lt;/a&gt;. You can read every&lt;br&gt;
line, or run your own copy with one Docker command.&lt;/p&gt;
&lt;h2&gt;
  
  
  What it answers
&lt;/h2&gt;

&lt;p&gt;Ask it about an address, and you get the network that owns it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"ipAddress"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"73.1.2.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"ipVersion"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"isPublic"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"network"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"asn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7922&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Comcast Xfinity"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"organization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"COMCAST-7922 - Comcast Cable Communications, LLC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"countryCode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"US"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"range"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"73.0.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"end"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"73.255.255.255"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"isHosting"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"dataUpdatedAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-11-04T21:46:11+00:00"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are two endpoints: &lt;code&gt;GET /api/tools/isp&lt;/code&gt; for the caller's own address, and &lt;code&gt;GET /api/tools/isp/{ip}&lt;/code&gt; for&lt;br&gt;
any IPv4 or IPv6 address.&lt;/p&gt;

&lt;h2&gt;
  
  
  Privacy rules the code has to follow
&lt;/h2&gt;

&lt;p&gt;We wrote these down before writing any code, and the project treats breaking one as a security bug:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Lookups run against local data only.&lt;/strong&gt; No address is ever sent to another service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Addresses are never logged or stored.&lt;/strong&gt; Not in request logs, not in error logs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Responses are sent with &lt;code&gt;Cache-Control: no-store&lt;/code&gt;,&lt;/strong&gt; so no proxy or browser cache keeps a copy.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The only place an address lives, even briefly, is in memory as the key for the per-minute rate limit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the data comes from
&lt;/h2&gt;

&lt;p&gt;The lookup uses the free &lt;a href="https://iptoasn.com" rel="noopener noreferrer"&gt;iptoasn.com&lt;/a&gt; dataset, which is public domain. It's one&lt;br&gt;
compressed file listing every block of IP addresses on the internet and the network (ASN) that announces it.&lt;/p&gt;

&lt;p&gt;The app reads the whole file into memory once and sorts the blocks by their first address. Finding the network&lt;br&gt;
for an address is then a binary search: look at the middle block, decide whether the address comes before or&lt;br&gt;
after it, and halve the list until you land on the right block. With roughly half a million blocks, that's&lt;br&gt;
about 20 steps per lookup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Swapping in fresh data without a restart
&lt;/h2&gt;

&lt;p&gt;The dataset changes daily, and we didn't want a restart (or a slow moment) every time it did. So a background&lt;br&gt;
service checks the file now and then. When it changes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The new file is read and sorted &lt;strong&gt;in full, in the background&lt;/strong&gt;, while lookups keep using the old copy.&lt;/li&gt;
&lt;li&gt;Only when the new copy is complete is it swapped in, in one step.&lt;/li&gt;
&lt;li&gt;If the new file is missing or broken, it's ignored and the old copy keeps answering.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Lookups never wait, and never see half a file. The cost is memory: while a reload runs, both copies are in&lt;br&gt;
memory for a moment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turning registry names into names people know
&lt;/h2&gt;

&lt;p&gt;Networks are registered under names like &lt;code&gt;COMCAST-7922 - Comcast Cable Communications, LLC&lt;/code&gt;, which isn't what&lt;br&gt;
anyone calls their ISP. A small formatter tidies them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it removes the registry code in front ("COMCAST-7922 - ")&lt;/li&gt;
&lt;li&gt;it removes legal endings ("Inc", "LLC", "GmbH", "Co., Ltd")&lt;/li&gt;
&lt;li&gt;it softens names written in capitals ("BELL MOBILITY" → "Bell Mobility")&lt;/li&gt;
&lt;li&gt;it swaps in the brand customers know ("Charter Communications" is sold as Spectrum)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's a best guess, so the raw registered name is always returned alongside as &lt;code&gt;organization&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is it a home connection or a data center?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;isHosting&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt; for networks that belong to cloud, hosting and VPN providers. It's deliberately&lt;br&gt;
conservative: &lt;code&gt;true&lt;/code&gt; means "this is a known hosting network", but &lt;code&gt;false&lt;/code&gt; doesn't prove an address is someone's&lt;br&gt;
home connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run it yourself
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/elidotexe/comparevpn-tools
&lt;span class="nb"&gt;cd&lt;/span&gt; comparevpn-tools
docker build -t comparevpn-tools .
docker run -p 8080:8080 comparevpn-tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open &lt;code&gt;http://localhost:8080/api/tools/isp/8.8.8.8&lt;/code&gt;. The image ships with a copy of the dataset, so it&lt;br&gt;
answers straight away, and it downloads a fresh copy every 24 hours by itself. Every setting (rate limit,&lt;br&gt;
allowed websites, trusted proxies) can be set with an environment variable, and a bad value stops the app at&lt;br&gt;
startup with a message naming it, rather than failing on a visitor's request later.&lt;/p&gt;

&lt;p&gt;Running without Docker works too: you need the .NET 10 SDK, a download script fetches the dataset, and&lt;br&gt;
&lt;code&gt;dotnet run&lt;/code&gt; starts the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;The ISP checker is the first tool. The repository is set up so each new tool gets its own folder, settings and&lt;br&gt;
tests, and reuses the same address data where it makes sense.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Questions, ideas, or a tool you'd like to see? Come say hi in&lt;br&gt;
&lt;a href="https://github.com/elidotexe/comparevpn-tools/discussions" rel="noopener noreferrer"&gt;GitHub Discussions&lt;/a&gt;.&lt;/strong&gt; And if you spot a privacy&lt;br&gt;
problem, please report it privately as described in the repo's security policy.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>opensource</category>
      <category>privacy</category>
      <category>selfhosted</category>
    </item>
  </channel>
</rss>
