Dobec was first mentioned in 1262, and again in 1292, as a property belonging to the Carthusian monastery in Bistra.[2][3]
In June 2005, part of the settlement ceded from Dobec and merged with the settlement of Pokojišče in the Municipality of Vrhnika.
Mass graves
Dobec is the site of two known mass graves associated with the Second World War. They are located northwest of the settlement in the Ravnik Valley. The Mihec Shaft Mass Grave (Шаблон:Lang-sl) is also known as the Matjaž Shaft Mass Grave (Шаблон:Lang). It is believed to have contained the remains of three locals that were murdered because of their opposition to the Yugoslav Partisan movement. The local villagers removed the remains before May 1991.[4][5] The Vodišek Shaft Mass Grave (Шаблон:Lang) is Шаблон:Convert deep, with its entrance at the bottom of a sinkhole. Human remains are located on two shelves in the shaft and the floor of the shaft. The victims were people from nearby villages that were ambushed and murdered.[6]
Church
The local church, built outside the settlement to the north, is dedicated to Saint Leonard and belongs to the Parish of Begunje pri Cerknici.[7] The church was first recorded in written sources in 1322.[2]