On the long road towards central Australia, as you travel 848km (527 miles) north from Adelaide's coastal plains, is a scattering of enigmatic sand-pyramids. Around them, the landscape is utterly desolate – an endless expanse of salmon-pink dust, with the occasional determined shrub.
But as you venture further along the highway, more of these mystery constructions emerge – piles of pale earth, haphazardly scattered like long-forgotten monuments. Every now and then, there is a white pipe sticking up from the ground next to one.
These are the first signs of Coober Pedy, an opal mining town with a population of around 2,500 people. Many of its little peaks are the waste soil from decades of mining, but they are also evidence of another local specialty – underground living.
In this corner of the world, 60% of the population inhabits homes built into the iron-rich sandstone and siltstone rock. In some neighbourhoods, the only signs of habitation are ventilation shafts sticking up, and the excess soil that has been dumped near entrances.
In the winter, this troglodyte lifestyle may seem merely eccentric. But on a summer's day, Coober Pedy – loosely translated from an indigenous Australian term that means "white man in a hole" – needs no explanation: it regularly hits 52C (126F), so hot that birds have been known to fall from the sky and electronics must be stored in fridges.
This year, the strategy seems more prescient than ever. In July, the city of Chongquing, in southwest China, resorted to opening up air raid shelters built during WW2 – amid large-scale bombing from Japan – to shelter citizens from a very different threat: a 10-day streak of weather above 35C (95F). Others have been retreating to underground "cave hotpot" restaurants, which are popular in the city. As the blistering three-month heatwave continues in the US – with temperatures even cacti can't handle – and wildfires incinerate swathes of southern Europe, what could we learn from Coober Pedy's residents?
A long history
Coober Pedy is not the world's first, or even its largest, subterranean settlement. People have been retreating underground to cope with challenging climates for thousands of years, from the human ancestors who dropped their tools in a South African cave two million years ago, to the Neanderthals who created inexplicable piles of stalagmites in a French grotto during an ice age 176,000 years ago. Even chimpanzees have been observed cooling down in caverns, to help them cope with the extreme daytime heat in southeastern Senegal.
Walking in the desert around Coober Pedy can be perilous - the landscape is pitted with abandoned mining shafts (Credit: Getty Images)
Take Cappadocia, an ancient district of central Turkey. The region sits on an arid plateau, and is famous for its striking, almost fantasy geology, with a landscape of sculpted pinnacles, chimneys, and spires of rock, like a kingdom in a fairytale. But it is what's among these that is truly spectacular.
According to popular rumour, it all started with some disappearing chickens. In 1963, a man was knocking through the basement of his home when his poultry kept going missing. He soon found they were disappearing into a hole he'd accidentally opened up, and after clearing the way, he followed them in. From there, things became even stranger. The man had discovered a secret passageway – a steep subterranean path that led to a labyrinth of niches and further corridors. This was one of many entrances to the lost city of Derinkuyu.
Derinkuyu is just one of hundreds of cave dwellings and several underground cities in the area, and is thought to have been built around the 8th Century BC. It was almost constantly inhabited for millennia – with its own ventilation shafts, wells, stables, churches, warehouses and a vast network of underground homes – and doubled as an emergency shelter for up to 20,000 people, in case of invasion.
Like at Coober Pedy, subterranean living helped the region's inhabitants to cope with the continental climate, which swings between hot, dry summers and frigid, snowy winters – while outside, it varies from well below zero to above 30C (86F), underground it is always 13C (55F). (Read more about the ancient city of Derinkuyu from BBC Travel.)
Even now, the region's man-made caves are renowned for their passive cooling abilities – a building technique involving using design choices instead of energy to reduce heat gain and loss. Today Cappadocia's ancient galleries and passages are piled high with thousands of tonnes of potatoes, lemons, cabbages, and other produce that would otherwise need to be refrigerated. They are in such popular demand, new ones are being built.
An effective solution
Further along the road to Coober Pedy is the main town. At first glance, it could be mistaken for an ordinary outback settlement – the streets are pink with dust, and there are restaurants, bars, supermarkets and petrol stations. On a ridge overlooking all this is the town's only tree, a sculpture made of metal. Coober Pedy is eerily empty. The buildings are widely spaced, and something doesn't quite add up.
But below ground, all is explained. Some of Coober Pedy's "dugouts", as they are known, are accessed through what look like small ordinary buildings – as you step inside, their underground passages gradually reveal themselves, like stepping through a wardrobe into Narnia. Others are more obvious – at Riba's, a campsite where people can pitch their tents in niches several metres below ground, the entrance is a dark tunnel.
Derinkuyu was abandoned in 1923, and totally forgotten until it was rediscovered in the 1960s (Credit: Getty Images)
In Coober Pedy, subterranean buildings must be at least four metres (13ft) deep, to prevent their roofs collapsing – and under this amount of rock, it is always a balmy 23C (73F). While above-ground residents must endure oven-hot summers and frigid winter nights, where it regularly dips to 2-3C (36-37F), subterranean homes remain at perfect room temperature, 24 hours a day, year-round.
Apart from comfort, one major advantage of underground living is money. Coober Pedy generates all its own electricity – 70% of which is powered by wind and solar – but running air conditioning is often impossibly expensive. "To live above ground, you pay an absolute fortune for heating and cooling, when it's often above 50C (122F) in the summer", says Jason Wright, a resident who runs Riba's.
On the other hand, many underground homes in Coober Pedy are relatively affordable. During a recent auction, the average three-bedroom house sold for around AU$40,000 (£21,000 or US$26,000). Though many of these properties were extremely basic or in need of renovation, there's a large gap between these valuations and those in the nearest major city, Adelaide, where the average house price is AU$700,000 (£361,000 or US$457,000). Other benefits include zero insects – "when you get to the door flies jump off your back, they don't want to come into the dark and the cold," says Wright – and a lack of sound and light pollution.
Oddly, the subterranean lifestyle might also provide some protection against earthquakes, which Wright describes as producing a vibrating noise that builds to a crescendo, then rolls through to the other side of the dugout. "We've had two since I've lived here and I've never even flinched," he says. (However, how safe underground structures are during seismic activity is entirely dependent on how large, complex and deep they are.)
In Coober Pedy, the rock is so soft it can be scratched with a fingernail (Credit: Alamy)
An ideal setup
The question is, could underground homes help people to cope with the effects of climate change elsewhere? And why aren't they more common?
There are several reasons why making dugouts in Coober Pedy is uniquely practical. The first is the rock – "It's very soft, you can scratch it with a pocket knife or your fingernail," says Barry Lewis, who works at the tourist information centre.
Back in the 1960s and 70s, the residents of Coober Pedy expanded their homes the same way they created the opal mines – using explosives, pickaxes and shovels. Some didn't require much digging at all, with many locals using abandoned mine shafts as a starting point. Today they are often excavated with industrial tunnelling equipment. "A good tunnelling machine can do about six cubic metres (211 cubic ft) of rock per hour, so you could have a dugout made in less than a month," says Wright.
However, it's still possible to excavate by hand – so when residents need more space, they sometimes simply start hacking. And as an opal mining area, it's not unheard of for a renovation project to actually make money. One man discovered a large gem sticking out of the wall when he was installing a shower, and a local hotel discovered opals worth AU$1.5m (£774,000/$985,000) while building an extension.
Furthermore, the sandstone is structurally sound without supports, so it's possible to make (literally) cavernous rooms with high ceilings, in any shape you like, with no additional materials. In fact, tunnelling in Coober Pedy is so straightforward, many locals live in elaborate, luxury dwellings, with underground swimming pools, games rooms, expansive bathrooms, and high-spec living rooms. One local has previously described his subterranean home as "like a castle", with 50,000 tumble bricks and arched doorways to every room.
"We've got some stunning dugouts here," says Wright, who explains that the residents are notoriously private – another possibility when you live underground – so you only tend to find out about them when you're invited over for dinner.
A question of moisture
However, the feats at Cooper Pedy would not be possible everywhere. One major challenge with any underground structure is damp.
In Cappadocia, there are many houses cut into the volcanic rock, though these are no longer occupied (Credit: Getty Images)
Of the many rock dwellings that have been inhabited by humans, the majority are in dry areas – from the towers and walls built onto the cliffs at Mesa Verde in Colorado, inhabited for over 700 years by the Ancestral Pueblo people, to the elaborate temples, tombs and palaces cut into the pink sandstone at Petra, Jordan. Today, one of the last inhabited rock-cut villages in the world is Kandovan, in the foothills of Mount Sahand in Iran – a valley scattered with strange, pointed caves that have been hollowed out into houses, like a colony of termite mounds. The area receives just 11mm (0.43in) of rainfall each month on average throughout the entire summer.
On the other hand, building underground in wetter areas is notoriously tricky. To waterproof the original London underground tunnels, which were built in the 19th Century, each one was encased in several layers of brick and a liberal coating of bitumen (today more modern methods are used). But even with those precautions, there are still regular reports of black mould. The same issue plagues basements, bunkers and car parks in high-rainfall areas throughout the globe.
There are two main reasons for this: a lack of ventilation, which can allow moisture from cooking, showering and breathing to condense onto a cave's cool walls, and groundwater – if underground homes are built near the water table.
In Coober Pedy, it's not just homes that are underground - there are subterranean restaurants, shops, motels, and even a Serbian Orthodox Church (Credit: Getty Images)
Take the Hazan Caves in Israel, a complex network of underground hideouts built by Jewish people avoiding persecution by the Romans in the 2nd Century AD – complete with olive presses, kitchens, halls, water reservoirs and a columbarium for storing funerary urns. Just 66m (217ft) into the cave, the temperature drops significantly compared to outside, but the humidity also leaps from just 40% to double this level. This may be partly because the cave system is built into porous rock in a lowland area – where there tends to be more groundwater. With narrow passageways and limited entrances, it also has poor air flow.
The emissions from travel it took to report this story were 0kg CO2. The digital emissions from this story are an estimated 1.2g to 3.6g CO2 per page view. Find out more about how we calculated this figure here.
But in Coober Pedy, which sits on 50m (164ft) of porous sandstone, conditions are arid even underground. "It's very, very dry here," says Wright. Ventilation shafts are added to ensure an adequate supply of oxygen and to allow moisture from indoor activities to escape, though these are often just simple pipes sticking up through the ceiling.
There are some other downsides to these heatwave-proof bunkers. Lewis currently lives above ground on a caravan park, after his underground home – at the very same spot – collapsed. "It doesn't happen very often," he says. "It was on bad ground." It's also not unheard of for residents to accidentally knock through into a neighbour's house.
Despite the setback, Lewis misses dugout life – and Wright would highly recommend it to anyone who is currently suffering in unreasonably high temperatures. "It's a no-brainer when you experience that heat," he says.
Perhaps soon Coober Pedy's peculiar sand-pyramids will start popping up in other places too.
If you liked this story, sign up for the weekly bbc.com features newsletter, called "The Essential List" – a handpicked selection of stories from BBC Future, Culture, Worklife, Travel and Reel delivered to your inbox every Friday.