OTTAWA - The federal government is forcing rail companies to tell municipalities when they transport dangerous goods through their communities.

Transport Minister Lisa Raitt has issued what's called a protective direction, in the hope it will mean better communication with rail companies and improved safety for municipalities.

The directive comes months after the deadly July 6 derailment and explosion in Lac-Megantic, which killed dozens of people and decimated the centre of the picturesque Quebec town.

The order is effective immediately, and will require that Canadian Class 1 railway companies that transport dangerous goods provide municipalities with detailed dangerous goods information every three months.

Any other company or person that transports dangerous goods will also have to inform municipalities what was transported through the community, but on an annual basis.

None of the information has to be provided in advance.