Solved, the direct reason is that github is directed to localhost.
Further reason is that dns server is set to an known device on local network.
Fixed when setting dns server to 8.8.8.8