Wednesday, February 04, 2026

What is my public IP address for IBM i

There are times you might want to check your public IP address from your IBM i system. Fortunately you can use the curl command and the QSHCURL command from a CL or RPG program to determine your current IP address if you're using the FREE QShell on i (QSHONI) software (https://www.github.com/richardschoen/qshoni) I created to integrate your PASE program calls to a traditional IBM i program. 

Making the CL API call to curl is as simple as this: 

QSHONI/QSHCURL CMDLINE('https://api.ipify.org') DSPSTDOUT(*YES)

And the results automatically show up in outfield QTEMP/STDOUTQSH for you to utilize from your CL or RPG programming. 

Example IP address response written from STDOUT to the first record of the outfile: 32.1.1.22

Check out QShell on i to be able to run curl commands and much more. 

If you find some interesting use cases create an issue on the GitHub site, post a comment or email me and I can publish as an example. 


No comments: