Skip to content

Yet another ifconfig / what's my IP clone but in Rust


Notifications You must be signed in to change notification settings


Repository files navigation


Production deployed Build Status GitHub release license

ifconfig-rs is yet another "what's my IP address" service currently powering It is written in Rust (hence the "-rs" suffix) using the Rocket web framework and includes GeoLite2 data created by MaxMind, available from The UI is made with uikit. It is MIT licensed so please feel free to clone and to fork it.

ifconfig_rs offers an API to query information like the origin's IP address, TCP port, host name, geoip based location, ISP, as well as user agent. See for API and special CLI tool support.

Table of Contents


  • It's really fast.

  • Shows your IP address, TCP port, host name, geoip based location, ISP, and user agent.

  • Google Maps integration for geoip location


  • Special support for CLI tools like curl, httpie, and wget. API calls will be answered with just the base information followed by a newline for easy script integration.

Another "What's my IP" service? But why?

Well, first of all, everybody should have a "What's my IP" service and I wanted to do a little web project using Rust and Rocket. I have been strongly inspired by ipd which powers I've added a few details though and I think the UI is nicer.


The file Rocket.toml sets the various runtime parameters.


If you omit the runtime setting, the TCP connection's remote IP address will be presented as your IP address. In case the runtime is set to "xforwarded", the X-Forwarded-To header is used to determine your IP address. In case you another runtime environment, make sure that you get the real origin IP address -- see section Koyeb.


This sets the title, name etc. of the website in the index.html template file.


The base URL sets the base URL for the CLI examples.

Web Server Configuration

For web server specific settings like listen IP address and port etc. please see Rocket's documentation.

Deployment Prerequisites

You have to run make get_geoip to retrieve the latest MaxMind geoip and ASN databases.

Koyeb (and other providers using load balancers)

Koyeb uses load balancers to route incoming traffic to apps. On this route, the original remote IP address is masqueraded by the load balancers. Therefore, you can not rely on the TCP connection's remote IP address to identify the request origin's IP address. If the load balancers behave like good citizens, then they add the requesters IP address to the HTTP header X-Forwarded-For. From this list, you can gather the origin's IP address. _ifconfig_rs uses a Rocket Fairing; see for details.


  • The IP address is wrong! WTH?

    Yes, that's possible. It turns out that determining the originating IP address of an HTTP request is not as easy as it might seem. For example, there might be transparent proxies, load balancers, and even NAT gateways on the path from your browser to ifconfig-rs. Even though, ifconfig-rs uses a heuristic to determine the originating IP address, information may be hidden or removed which might lead to wrong results. If you encouter such a scenario, open an issue on GitHub and let's try to enhance the heuristic together.

  • Where is hosted?

    The code runs on Koyeb.

  • Does ifconfig-rs support IPv6?

    Yes. The code is agnostic regarding the IP version.

  • Can I run my own instance of ifconfig-rs?

    Yes please, you're welcome to. Just clone or fork this repository. If you find it useful for your purpose, I would highly appreciate you sending me a postcard from your hometown mentioning how you use it. See my address.

  • Can you add <feature>, please?

    Yes, why not. Just contact me and let's discuss the details. Better, do it yourself and send me a pull request.


You're free to use ifconfig-rs. If you find it useful, I would highly appreciate you sending me a postcard from your hometown. My work address is

Lukas Pustina
CenterDevice GmbH
Rheinwerkallee 3
53227 Bonn