# Get your public IP

Useful when you want to add your IP to a security group in AWS on the command line for example

## IPv4 - OpenDNS Resolver

```SHELL
dig +short myip.opendns.com @resolver1.opendns.com
```

## IPv4 - Google Resolver

```SHELL
dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com
```

## IPv6 - Google Resolver

```SHELL
dig -6 TXT +short o-o.myaddr.l.google.com @ns1.google.com
```

