The New Zealand Herald reported that the exchange had gone down at 11.24am local time (9.24am AEDT) on Wednesday and resumed operations at 12.20pm.
On Tuesday evening, the exchange could not operate during its last hour, due to a similar reason.
This outage happened as the exchange was approaching a record closing.
On Tuesday evening, Spark, which is the network service provider for the exchange, said in a statement: "This afternoon a Spark customer, NZX Limited, experienced a volumetric DDoS (distributed denial of service) attack from offshore, which impacted NZX system connectivity.
"As such, NZX decided to halt trading in its cash markets at approximately 15.57.
"A DDoS attack aims to disrupt service by saturating a network with significant volumes of internet traffic. The attack was able to be mitigated and connectivity has now been restored for NZX."
Spark was contacted this morning, but referred iTWire to the stock exchange instead.