Rory Holden’s header five minutes before the break paved the way for a historic Conference League victory, which was wrapped up in the final quarter after Branimir Kalaica handled a powerful shot from substitute Adam Wilson.
Declan McManus sent his 78th penalty down the middle as Aleksandr Zarutskiy dived to his right, and there was no route back for the Kazakhstan visitors after that.
Shrewsbury’s Croud Meadow played host to Welsh football’s big night with UEFA regulations preventing TNS from playing at their Oswestry home 20 miles away.
Astana had made a marathon trip to Shropshire on Tuesday with a nine-hour flight to London and a three-hour coach journey to their Telford base.
They had beaten Serbian side TSC in this competition three weeks ago, but domestic matters were clearly on their mind with 11 players left at home ahead of Sunday’s Kazakhstan Premier League clash against Aktobe.
TNS – fresh from a 16-0 Welsh Cup record-equalling victory over Llangollen – would have been lifted by news of facing Astana’s second string after losing their Conference League opener 2-0 at Fiorentina.
Connor Roberts had excelled himself at the Artemio Franchi Stadium by keeping Fiorentina out for 65 minutes, but he was almost beaten straight away as Ramazan Karimov’s shot bounced off a post.
Roberts’ strong hand denied Stanislav Basmanov from the angle before TNS exhibited their counter-attacking ability.
McManus managed to get his toe on Holden’s cross and force a save from Zarutskiy.
Another slick TNS break ended with McManus meeting Jordan Williams’ cross, though it lacked the power to trouble Zarutskiy.
Astana failed to make their bulk of possession count as attacks broke down in the final third, and their carelessness was punished before the interval.
McManus held the ball up well and Ryan Brobbel sprayed a delightful pass to the left.
Williams was played into space and Holden – who has trod the Football League boards at Rochdale, Barrow, Walsall and Port Vale – dispatched his inviting cross with a superb header.
TNS saw strong claims for a penalty rejected two minutes later after Holden’s effort was cleared off the line by Abzal Beysebekov.
Holden was taken out by Zarutskiy after making contact with the ball, but neither Estonian referee Juri Frischer nor VAR were interested in TNS appeals.
The only upshot was a booking for Craig Harrison over his touchline protest, but the TNS boss must have been delighted with the maturity of his side’s performance.
Zarutskiy’s double save from Daniel Williams and McManus stopped TNS from extending their lead at the start of the season.
Astana pushed for an equaliser and Nnamdi Ahanonu rattled the woodwork with Roberts’ touch proving vital, but their resistance was ended as McManus kept his cool from 12 yards.