A complete sample of bright Swift gamma-ray bursts (GRBs) have been recently selected by Salvaterra et al. The sample has a high level of completeness in redshift (90 per cent). We derive here the intrinsic absorbing X-ray column densities of these GRBs making use of the Swift/X-ray Telescope data. This distribution has a mean value of log (NH/cm−2) = 21.7 ± 0.5. This value is consistent with the distribution of the column densities derived from the total sample of GRBs with redshift. We find a mild increase in the intrinsic column density with redshift. This can be interpreted as due to the contribution of intervening systems along the line of sight. Making use of the spectral index connecting optical and X-ray fluxes at 11 h (βOX), we investigate the relation between the intrinsic column density and the GRB ‘darkness’. We find that there is a very tight correlation between dark GRBs and high X-ray column densities. This clearly indicates that the dark GRBs are formed in a metal-rich environment where dust must be present.