The House of Commons backed the European Union Referendum Bill as expected by 544 votes to 53 but the measure must now pass through several other parliamentary debates and votes before becoming law.
Six hours of speeches highlighted divisions within Cameron's centre-right Conservatives over Europe and the problems he faces en route to the referendum with a narrow 12-seat majority and dozens of MPs likely to back leaving.
Opening proceedings, Foreign Secretary Philip Hammond said many Britons felt "the EU has come to feel like something that is done to them, not for them".
"It is time to bring Europe back to the people, ensuring decisions are made as close to them as possible and giving national parliaments a greater role in overseeing the European Union," Hammond added.
More From This Section
The referendum, which is due by the end of 2017 but could be held as early as next year, was triggered when the Conservatives won a majority in last month's general election.
He is expected to outline formally a list of demands at a European Council summit later this month. These are likely to include making it harder for EU migrants to claim state benefits in Britain.
Cameron will vote in favour of remaining in the EU if he can secure the changes he wants, while opinion polling currently suggests British voters would back staying in Europe.