NetSuite / SuiteScript: Getting A Remote IP Address

Published on May 24, 2019.

I'm currently working on a NetSuite integration project, and in one of the Suitelets, I need to get the remote IP address of the user or client.

An easy way to get the value is via the request headers. For example:

var ip = context.request.headers['ns-client-ip'];

There are several other interesting and potentially useful headers that are available, including the the user-agent (ex: "Mozilla/5.0"), the NetSuite host (ex: "startron11.extforms.netsuite.com"), and so on. To get a sense of what's available, log the headers, like this...

log.debug( { title: 'Headers', details: context.request.headers } );

Then review the script's Execution Log.

About Me

Hello, I’m Tim Dietrich. I design and build custom software for businesses running on NetSuite — from mobile apps and Web portals to Web APIs and integrations.

I’ve created several widely used open-source solutions for the NetSuite community, including the SuiteQL Query Tool and SuiteAPI, which help developers and businesses get more out of their systems.

I’m also the founder of SuiteStep, a NetSuite development studio focused on pushing the boundaries of what’s possible on the platform. Through SuiteStep, I deliver custom software and AI-driven solutions that make NetSuite more powerful, accessible, and future-ready.

Copyright © 2025 Tim Dietrich.