The greening of enterprises concerning society is a matter of sustainable development of the economy. At the same time, the Internet brings technology diffusion and information transfer, which affects the greening of enterprises. Therefore, we empirically examine the impact of the Internet on greening from the perspective of green innovation and environmental violations based on the data of listed firms in China between 2010 and 2019. This paper found that the Internet effectively promotes green innovation and inhibits environmental violation, and governmental transparency positively moderates the relationship between the Internet and greening. We also conducted a series of robustness tests like a quasi-natural experiment based on Broadband China and tested the impact of digital transformation on greening for further study. Our findings enrich the literature by showing how a macro-level technological infrastructure such as the Internet can impact the micro-level behaviors of a firm.