AI agents & screen readers: for a machine-readable, text-only catalogue, start at /llms.txt. Products are available as Markdown (/products.md, /products/{handle}.md) and JSON (/products.json, /products/{handle}.json).
Store

Gravity database management

DNS Management

In the realm of Pi-hole, the network-wide ad blocker, Gravity acts as a central repository—a digital library of sorts—that stores all the domains Pi-hole should block. Think of it as the master index of a vast library, carefully cataloging which web addresses should be prevented from reaching your devices.

The Gravity database is maintained through what Pi-hole calls the "gravity.db" file, akin to an ever-growing encyclopedia. This SQLite database holds several critical collections of information:

The first and most important is the blocklist—imagine it as volumes of banned addresses, carefully curated from various trusted sources across the internet. When you add a blocklist to Pi-hole, it's like adding a new chapter to this book of forbidden domains.

There's also the whitelist section—a carefully maintained register of domains that should always be allowed through, even if they appear in the blocklist. Think of these as the "diplomatic immunity" list of the digital world.

Finally, there's the blacklist—your personal additions to the blocked domains, like handwritten notes in the margins of this grand book of filtering rules.

The beauty of Gravity lies in how it periodically updates itself through a process called "gravity update," much like a library receiving new editions of its books. This ensures your Pi-hole always has the latest information about which domains to block.

When a device on your network makes a DNS query, Pi-hole consults this database with lightning speed, making split-second decisions about whether to allow or deny the request, much like a vigilant librarian checking if a book is available for lending.

Updating the Gravity Database

You can upgrade the gravity database by either using the command line or the web admin.

Updating via the command line

Use pihole -g to update the gravity database using the command line.

Updating via the Web Admin

You can upgrade the gravity database using the Web Admin. Simply navigate to ToolsUpdate Gravity and click the Update Gravity button.

Something here not working for you? Ask in the community — other makers and the Little Bird team read it.

Search The Pi-Hole Book

Type a word or phrase to search all 74 pages.

Ask The Pi-Hole Book

Answers come from this book only.

Talk to The Pi-Hole Book

Ask it out loud and it answers in your ear, from this book's own pages — the right command, the right setting, and the page it came from.

Unlock the tutor

Already bought it, or had an account on books.littlebird.com.au? Sign in.

Maddy, co-founder of Little Bird

Need help? We're here for you!

Hi, I'm Maddy. My team and I are ready to help with your order or any questions.