> For the complete documentation index, see [llms.txt](https://www.locksmith.guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.locksmith.guide/keys/more/ip-address-keys.md).

# IP address keys

Locksmith supports permitting visitors based on their IP address.

## Setup

Start by opening the settings for a lock you've created. Then, follow the steps shown to add a key that permits "if the customer has a certain IP address", as shown below:

![](https://277214568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUeGWHuijBPr8Og1Gta%2Fuploads%2FU0L3VRfbYIrvycvh36nl%2FScreenshot%202025-08-18%20at%2011.44.42%E2%80%AFAM.png?alt=media\&token=cd59347b-c5bd-439f-a878-10b2583c4faf)

![](https://277214568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUeGWHuijBPr8Og1Gta%2Fuploads%2F81y5mrTEjk8c3wPBbluF%2FScreenshot%202025-08-18%20at%2011.45.56%E2%80%AFAM.png?alt=media\&token=8c7308e8-14f8-4dbc-a794-b3545a459782)

This key can be configured with a series of IP addresses, one given per line. It can also be configured with CIDR definitions, allowing you to specify entire subnet ranges.

## Notes

This key condition can be inverted, resulting in a condition that permits *unless* the visitor has a certain IP address. When used with a lock on your entire online store, this is a useful way to block certain visitors.

To accomplish this, invert the key condition, as shown below by clicking on the checkbox next to "invert". (To learn more about inverting conditions, see [Inverting keys in Locksmith](https://www.locksmith.guide/keys/more/inverting-conditions-in-locksmith.md).)

![](https://277214568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUeGWHuijBPr8Og1Gta%2Fuploads%2FsGxGXex0N4FRvW3ATXfC%2FScreenshot%202025-08-18%20at%2011.46.23%E2%80%AFAM.png?alt=media\&token=de5ab933-8aa1-4f82-8095-d8084edf009e)

Because of the way IP address detection works, a IP address key on your entire store will show *everyone* a spinner graphic for a moment, before your store's content is loaded. This will only happen once, if the visitor has an accepted IP address.

{% hint style="danger" %}
**Important**: When used, this key condition has the potential to negatively affect the SEO of any content that is locked in this way. [More information on SEO and Locksmith here](https://www.locksmith.guide/faqs/more/how-does-locksmith-affect-search-engines-and-seo.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.locksmith.guide/keys/more/ip-address-keys.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
