  The gamma-ray bursts hosts (GRBHs) are excellent targets to study the
extinction properties of dust and its effects on the global emission of distant
galaxies. The dust extinction curve is measured along the GRB afterglow line of
sight and the analysis of the spectral energy distribution (SED) of the host
galaxy gives access to the global dust attenuation of the stellar light. We
selected a sample of 30 GRBs for which the extinction curve along the GRB
afterglow line-of-sight (l.o.s) is measured in the rest-frame ultraviolet (UV)
up to optical and we analysed the properties of the extinction curve as a
function of the host galaxy properties. From these 30 GRBs, we selected seven
GRBHs with a good rest-frame UV to near infra-red spectral coverage for the
host. The attenuation curve was derived by fitting the SEDs of the GRBH sample
with the CIGALE SED fitting code. Different star formation histories were
studied to recover the star formation rates (SFR) derived using H$_{\alpha}$
luminosities. The most extinguished GRBs are preferentially found in the more
massive hosts and the UV bump is preferentially found in the most extinguished
GRB l.o.s. Five out of seven hosts are best fitted with a recent burst of star
formation, leading to lower stellar mass estimates than previously found. The
average attenuation in the host galaxies is about 70% of the amount of
extinction along the GRB l.o.s. We find a great variety in the derived
attenuation curves of GRBHs, the UV slope can be similar, flatter or even
steeper than the extinction curve slope. We find that the flatter (steeper)
attenuation curves are found in galaxies with the highest (lowest) SFR and
stellar masses. The comparison of our results with radiative transfer
simulations leads to a uniform distribution of dust and stars in a very clumpy
ISM for half the GRBHs and various dust-stars geometries for the second half of
the sample.
