During the May 27 visit, which was not announced ahead of time, Zelenskiy met with Ukrainian troops in the war-torn towns of Stanytsia Luhanska and Shchastya in the Luhansk region, according to the presidential press service.
The press service said the newly elected head of state made the trip to get acquainted with the positions of the Ukrainian military.
Zelenskiy also spoke with soldiers about living conditions, food quality, equipment, housing, social benefits, and staffing of units, the press service added.
"The conditions for the military that defends Ukraine must be good," Zelenskiy was quoted as saying.
Official photographs showed Zelenskiy, who donned slacks and a blue-collared shirt with the sleeves rolled up, looking over a military map with soldiers, treading through a field with them, and peering through a lookout toward enemy positions from inside a bunker.
His predecessor, Petro Poroshenko, preferred to wear military camouflage fatigues on his frequent visits to the front line.
Zelenskiy, who was inaugurated on May 20 after a landslide victory over Poroshenko, has said that bringing the war to an end is among his top priorities and that he is prepared to meet with Russian President Vladimir Putin in order to do so.
But Kremlin spokesman Dmitry Peskov has said that Putin, who did not congratulate Zelenskiy on his election victory, will do so after the Ukrainian leader resolves "the internal conflict in southeastern Ukraine" and his "first successes in normalizing Russian-Ukrainian relations."
The Kremlin has repeatedly denied fueling the war, which entered its sixth year last month, despite overwhelming evidence showing that it has covertly supported separatist forces in eastern Ukraine with funds, military equipment, and fighters.