The main Pakistani political parties last month backed a government proposal to seek negotiations with the militants, who have been waging a bloody insurgency against the state since 2007.
But the umbrella Tehreek-e-Taliban Pakistan (TTP) faction, a loose coalition of militant groups led by Hakimullah Mehsud since 2009, responded with a list of preconditions.
These included a government ceasefire and the withdrawal of troops from the tribal areas along the Afghan border where the militants have hideouts.
"The national leadership has decided to give dialogue a chance to deal with the issue of terrorism and Pakistan army fully supports this process," Kayani said while addressing a passing out parade of cadets in Abbottabad, 112 kilometres (70 miles) north of the capital Islamabad.
"The nation and the political leadership have to determine the parameters for holding such a dialogue... this process should bring unity among the nation instead of leading to a division," he said.
During the televised address at the Pakistan Military Academy, the general said it was essential to find a solution to terrorism which he described as negating the basic ideology of the nation and the teachings of Islam.
"The military will be more than happy if a solution to the problem is found through dialogue," he said, adding that the use of force would be the last option.
Kayani, who is retiring from his post next month at the end of a second tenure as army chief, dismissed speculations that the failure of counter-insurgency operations forced the military to go for dialogue.
"This is far from being a truth," he said, pointing to the successful 2009 military operations in the northwestern town of Swat, which was cleansed of terrorists within four months.
Pakistani Prime Minister Nawaz Sharif Thursday said his government was sincere about holding peace talks with the Taliban, after rebel chief Mehsud complained that no serious steps had been taken to open a dialogue.
Speaking after a security meeting in the troubled northwestern city of Peshawar, Sharif said progress was being made on the issue of opening negotiations.
His statement came a day after the broadcast of a BBC interview in which Mehsud said he was ready to sit down for talks but the government had "not taken any serious steps".