---
title: table.lookup_ip
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/table/table-lookup-ip
---

```
IP table.lookup_ip(ID id, STRING key, IP default)
```

**Available in:** all subroutines

Looks up the key `key` in the table `id`.
When the key is present, its associated `IP` value will be returned.
When the key is absent, the `default` value is returned.
The default value is required.

## Example

```vcl
table overrides IP {
  "/a": "203.0.113.0",
  "/b": "203.0.113.1",
  "/c": "203.0.113.2",

  # a regex key
  ~ "/[def]": "203.0.113.3",
}

set client.geo.ip_override = table.lookup_ip(overrides, req.url.path, client.ip);
```
