While working as a Salesforce Admin, the client asked me to restrict access to Salesforce for security reasons. The client wanted users to log in only from the company office network and block access from home or public Wi-Fi.
To meet this requirement, I whitelisted the office IP addresses in Salesforce using trusted IP ranges.
After this setup, users could log in only when they were connected to the office internet. Any login attempt from an unknown IP address was automatically blocked.
In this article, we will learn how to whitelist IP addresses in Salesforce so that users can log in only when they are connected to the defined whitelisted IP addresses.
What is an IP Address in Salesforce?
An IP address is a string of 4 numbers separated by periods; for example, 66.231.80.0 is an IP address. These IP addresses can range from 0.0.0.0 to 255.255.255.255.
In Salesforce, we used a list of specified IP addresses to prevent unauthorized access to the organization’s data. With these IP addresses, users can always log in without receiving a login challenge.
Salesforce support occasionally requests a subset of IP addresses to allow. It is advised that we should allow the entire list of Salesforce IP ranges for seamless access. Narrowing the range of IP addresses would put you at risk of interruptions in access for you and your users.
The Network Engineering team of Salesforce recommends allowing the following IP ranges:
| Region | Connections to Salesforce | Connections from Salesforce |
| USA | 3.228.190.251 34.206.116.149 35.174.143.92 52.203.77.201 54.156.107.163 54.158.77.4 54.163.166.54 54.83.60.38 107.21.202.122 | 3.225.151.145 3.225.240.254/32 18.204.28.162/32 18.211.105.61 34.197.58.108 34.204.111.166/32 52.3.16.30 52.22.251.194 52.70.135.185 |
How to Whitelist IP Addresses in Salesforce
Below, I will explain how to whitelist IP addresses in Salesforce so users can log in only from the defined IP addresses.
- Log in to Salesforce Org. -> Click on the Setup -> Home Page-> In the Quick Find Box, Search for Network Access. You will see an option under Security -> Click on Network Access.

- Here, you can add Trusted IP Address Ranges for your organization. Users can log in to Salesforce only from these trusted IP addresses.
- To add a new IP address range, click New.

- In this step, enter the Trusted IP Address range from which user logins are allowed.
- In the Start IP Address field, enter the lowest IP address in the range. Here I have added 204.0.0.0.
- In the End IP Address field, enter the highest IP address in the range (204.14.239.255). The Start and End IP addresses must be a valid IPv4 range.
- Enter a short note in the Description field and click the Save button.
- To allow login from a specific IP address, enter that IP address in both the Start and End IP Address fields.

After clicking the Save button, the new IP address range is created and added to the Trusted IP Ranges list, as shown in the image below.

Now we have successfully whitelisted a new IP address in Salesforce Lightning.
Whitelist IP Address in Salesforce Classic
Log in to your Salesforce account to whitelist an IP address in Salesforce Classic.
- On the home page of Salesforce Classic, click the Setup tab to open the Setup page.

- In the Quick Find box, search for Network Access, then select Network Access under Security Controls.

- In the Network Access setup, click on the New button to create a new IP address.

- Now, in the Trusted IP Range Edit window, enter the required details to specify the IP address range. The start and end IP address range must include no more than 33,554,432 addresses. For example, the following ranges are valid:
- 0.0.0.0 to 1.255.255.255
- 132.0.0.0 to 132.255.255.255
- In the Start IP Address field, enter the IP address range with the value of four sets. I have specified the Start IP Address as 52.203.77.201.
- In the End IP Address field, we can enter a value that is greater than or equal to the Start IP Address. So I have entered the End IP Address as 52.203.77.201, which is equal to the Start IP address.
- After specifying the IP addresses, enter the description in the Description field for the specified IP range, then click Save.

When we click the Save button, a new IP address will be created and appear in the list of Trusted IP Ranges, as shown in the picture below.

With the above step, we have successfully whitelisted an IP address in Salesforce Classic.
Conclusion
I hope you have got an idea about whitelisting an IP address in Salesforce Lightning and Classic. We also learned about the uses of IP addresses and when they are required to access them.
Additionally, we learned the valid range of IP addresses to use when whitelisting an IP address.
You may like to read:
- Mass Update Addresses in Salesforce
- Add address field to custom object in Salesforce
- Set IP Addresses at Org Level in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.