Machín takes over following a season in which the Basque Country club finished 16th in the first division of the Spanish league, three points above the relegation zone.
The team was being managed by interim coach Juan Muñiz since Asier Garitano was fired after a poor run of results following the pandemic break.
Machín coached Espanyol last year, but was fired in December after just two months in charge.
Espanyol finished last and was relegated. The club based in Barcelona on Tuesday hired Vicente Moreno as its new coach. It had been managed by Joaquín Pérez Rufete since firing Abelardo Fernández after the break.