Police are to get powers to force internet firms to hand over details that could help identify suspected terrorists and paedophiles.
The Anti-Terrorism and Security Bill will oblige internet service providers (ISPs) to retain information linking Internet Protocol (IP) addresses to individual users.
Home Secretary Theresa May said the measure would boost national security.
She said: "The Bill provides the opportunity to resolve the very real problems that exist around IP resolution and is a step in the right direction towards bridging the overall communications data capability gap.
"It is a matter of national security and we must keep on making the case for the Communications Data Bill until we get the changes we need."
However, the Lib Dems insisted that legislation - branded the "Snooper's Charter" - was "dead and buried".
Dr Steve Hewitt, from the University of Birmingham, says there isn't much more the government can do to tackle terrorism.
The terror threat posed by violent extremists has "evolved", one of the UK's most senior counter-terrorism officers has warned.