File photo: The Swiss Parliament in Bern, in June 2017. AFP
The so-called distributed denial of service (DDoS) attack, which makes websites or network resources unavailable by flooding them with malicious traffic, was by the same "NoName" group that carried out a similar attack on the Swiss parliament last week, the ministry said in a statement.
"Several federal administration websites are/were unavailable on Monday," it said, though the main Swiss government portal www.admin.ch remained accessible.
Federal administration specialists had quickly noticed the DDoS attack, it said, adding that they were "taking measures to restore the accessibility of the websites and applications as quickly as possible."
"The 'NoName' group has claimed responsibility for this attack online. This group was also behind the attack on parliament.ch that became known last week," it said.
The National Cyber Security Centre (NCSC) is analysing the attack along with the affected administrative units and working to determine the appropriate measures, it said, emphasising that no data is lost in a DDoS attack.
As in other countries, cyberattacks targeting companies, governments and even universities are on the increase in Switzerland.
Monday's announcement came after the government warned last week that it feared data might have been stolen in a ransomware attack on Xplain, a technology firm that provides software for several departments.
The Swiss army and the customs department are among the clients of Xplain, which supplies software to authorities specialising in homeland security.
The government said it did not believe that the Xplain systems have direct access to the federal administration systems.
Xplain accused a ransomware group called Play -- also accused of recently targeting two large Swiss media outlets -- of being behind the attack.