The man was wearing headphones as he worked in his home in Westfield Street in Heckmondwike, West Yorkshire, when the attacker struck on Wednesday.
He managed to call police when he regained consciousness and nothing was taken from the house.
Police said he was hit on the back of the head and treated in hospital for a minor head injury.
Any witnesses are urged to contact police.
A man knocked unconscious while he was doing DIY at his home came round to find racist graffiti on the wall.