The 28-year-old former Liverpool and Carlisle defender has cemented a regular place in the Caley Thistle team following his arrival from Tranmere last summer.
Manager Terry Butcher was keen to retain the player, whose consistency has helped the team challenge for a Europa league qualifying spot for next term.
Butcher said: "This is another piece in our playing jigsaw. David is one of these 'no frills' players who just gets his head down and gets on with the job.
"We are delighted he has pledged his future to the club for the next two years he has had a tremendous season and we look forward to more of the same from him."