Molecular separation of carbon dioxide (CO2) and methane (CH4) is of growing interest for biogas upgrading, carbon capture and utilization, methane synthesis and for purification of natural gas. Here, we report a new zeolitic-imidazolate framework (ZIF), coined COK-17, with exceptionally high affinity for the adsorption of CO2 by London dispersion forces, mediated by chlorine substituents of the imidazolate linkers. COK-17 is a new type of flexible zeolitic-imidazolate framework Zn(4,5-dichloroimidazolate)2 with the SOD framework topology. Below 200 K it displays a metastable closed-pore phase next to its stable open-pore phase. At temperatures above 200 K, COK-17 always adopts its open-pore structure, providing unique adsorption sites for selective CO2 adsorption and packing through van der Waals interactions with the chlorine groups, lining the walls of the micropores. Localization of the adsorbed CO2 molecules by Rietveld refinement of X-ray diffraction data and periodic density functional theory calculations revealed the presence and nature of different adsorption sites. In agreement with experimental data, grand canonical Monte Carlo simulations of adsorption isotherms of CO2 and CH4 in COK-17 confirmed the role of the chlorine functions of the linkers and demonstrated the superiority of COK-17 compared to other adsorbents such as ZIF-8 and ZIF-71.