---
name: "xt_geoip_query"
section: "1"
platform: "linux"
package: "xtables-addons-common"
version: "3.27-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/xt_geoip_query"
---

# xt\_geoip\_query(1)

dump a country database to stdout

## Name

xt\_geoip\_query — dump a country database to stdout

## Syntax

**xt\_geoip\_query** \[**-D** *database\_dir*\] \[**-4**\] \[**-6**\] *cc* \[ *cc* ... \]

## Description

xt\_geoip\_query reads a country's IPv4 or IPv6 databases and dumps them to standard output as a sorted, non-overlapping list of ranges (which is how they are represented in the database), suitable for browsing or further processing.

- **-D** *database\_dir*

  Specifies the directory into which the files have been put. Defaults to ".".

- **-4**

  Specifies IPv4 data only.

- **-6**

  Specifies IPv6 data only.

- *cc* \[ *cc* ... \]

  The ISO 3166 country code names of the desired countries' databases.

## Application

Shell command to dump the list of Swiss IPv6 address ranges:

xt\_geoip\_query -D /usr/share/xt\_geoip -6 ch

## See also

[xt\_geoip\_build(1)](/xt_geoip_build/1.md)
