The increasing international maritime transportation of freight has caused a huge operation in important ports, which are often established near cities and therefore do not have enough room for expanding the operations. This causes long delays and poor productivity in ports. The construction of dry ports has been proposed as a suitable solution to mitigate the problems. A dry port is an inland intermodal terminal directly connected to a seaport by road or rail, where importers and exporters can clear their cargo through customs and handle other shipping formalities. Selecting the right place for the establishment of dry ports has a significant impact on the time and costs of transportation in the network, as well as environmental consequences. In this research, to determine the optimal location of dry ports among the potential locations, three mathematical models as deterministic, stochastic, and robust with three objectives of minimizing the maximum transportation time in the entire network, environmental pollutants, and transportation costs are presented, which simultaneously specify the required number of dry ports in the network and the optimal place to build them. The presented models have been implemented for data related to 30 million bills of lading in a 10-year period in Iran with four major ports and 400 cities. Both deterministic and non-deterministic approaches reveal a preference not to build a dry port in the first optimal solution. However, in the following desirable answers, different answers have been suggested. According to the sensitivity analysis performed by making changes in the fuel price situation or the existing rail network, the model introduces several potential points for the construction of dry ports. The results of this model show that, with the construction of dry ports, despite the increase in overall costs of the network because of the construction of dry ports, operation, and storage in them, the amount of greenhouse gas emissions will decrease significantly.