Warehousing cows in cubicles is being tested in Canterbury in a bid to stop effluent polluting waterways.
The hangar-like barns are used to house dairy cows over winter and urine is collected and treated instead of being deposited directly on to paddocks.
Willy Leferink is trialling a life indoors for his herd on his mid-Canterbury dairy farm.
Because of the high impact of dairy farming on waterways, Environment Canterbury will only allow two-and-a-half cows per hectare - on current milk prices not enough for a profit.
The solution, Mr Leferink said, was keeping cows inside and off the paddocks in winter when higher rainfall made it more likely effluent filtered through the soil to the groundwater.
"Each cow has got its own cubicle and in general they stick to their cubicles, they don't like sleeping in others beds ... it's just a place that fits their body quite comfortably ... they lay on a rubber mat with foam underneath so it's quite soft and very comfortable for them to sleep on, there's quite a lot of research that went in to that.
''And the cubicles are quite flexible so they can push them around a bit."
Automated scrapers move through the barn taking away the huge amounts of urine and faeces produced by 900 cows and storing it until it can be safely spread around paddocks.
"We harvest all the time that they are inside plus the time that they are in the dairy shed and spread that effluent evenly over the farm instead of on that little spot where the cow piddles."
But farming indoors is no holiday, according to a professor of animal welfare and Save Animals From Exploitation spokesperson Andrew Knight.
"To confine them indoors where they don't have the option to go outside if they choose restricts a range of natural behaviours, causes stress and frustration.
''Cattle that are housed indoors have high rates of problems such as lameness which is very uncomfortable, quite painful actually for cattle. They also have high rates of mastitis."
Mr Leferink said the animals were well cared for and cows still being milked were outside for 12 hours when the sun was shining.
Those being dried off remained indoors permanently over winter. Given the choice, that was where the cows would head anyway, he said.
"I think it's really important to put the animal in an environment where they are nice and dry and protected from the elements. So today if you would give them a choice to be here or go outside to the paddock, they would go outside and come back in."
For those calving, a thick layer of straw was laid down and more space provided.
Professor Knight said indoor farming was more about maximising profits than animal welfare.
"Farmers are always keen I think to maximise the productivity of their animals and one of the ways to achieve that is to confine animals ... so they burn off less of the food they consume in exercise."
The current use of herd homes was not as bad as a Mackenzie District proposal in 2009 for 18,000 cows indoors for eight months of the year, he said.
But no system that involved confining large animals indoors for long periods of time was a good idea and could damage the country's reputation overseas, he said.
According to the council, there are 11 herd homes in Canterbury, with two housing animals year round.