Search notes:

Internet Protocol

Determining own IP address

Windows

In Windows, the IP address can be determined with a combination of ipconfig.exe and findstr.exe.
The PowerShell script ip.ps1 prints IP addresses of local non-loopback adapters.

Linux

dig +short myip.opendns.com @resolver1.opendns.com
Yet, this approach does not seem to work behind NAT.

Virtual machine

One of the following to commands should report the public IP address if executed in a virtual machine.
$ curl ipconfig.me
$ curl ipconfig.me/ip
Sometimes, it's necessary to get the IP4 address:
$ curl -4 ipconfig.me/ip

IPv6

See also Linux networking IPv6

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1743445923, '3.128.192.177', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/networking/IP(68): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78