Ibn al-Subki included al-Bukhari and Muslim among the Shafi`is while Ibn Abi Ya`la included them among the Hanbalis.
In truth, al-Bukhari was neither Shafi`i nor Hanbali but a Mujtahid Mutlaq with his own madhhab, which did not survive him as he was uninterested in other than his Sahih for a school, and the Sahih is truly a complex and concise fiqh manual. (It is therefore misleading to characterize the Six Books only as Kutub Zahir al-Riwaya - "the books of the external aspects of narration" cf. M. `Abd al-Latif Farfur in his Tarikh al-Fiqh al-Islami.)
Muslim was al-Bukhari's close student and probably followed his Madhhab, but he was definitely a Mujtahid murajjih i.e. s.o. with full knowledge of Ijma` and Khilaf, competent to evaluate all the pre-existing juridical conclusions of the Schools of the Companions and Tabi`in and choose the most correct in his view.
Al-Tirmidhi was also al-Bukhari's close student and a Mujtahid Murajjih and comparatist of the first rank whose method and school, like al-Bukhari, is developed in his book - the Sunan - not only in the chapter-titles like al-Bukhari, but in the bodies of the chapters themselves and in more explicit terms than his teacher. See `Itr's masterpiece _Al-Imam al-Tirmidhi wa al-Muwazana Bayna Jami`ihi wa Bayn al-Sahihayn_.
It is important to realize the huge debt these two owe to their teacher al-Bukhari. Our teacher Nur al-Din `Itr - Allah keep him in his best care - told us that without Muhammad ibn Isma`il al-Bukhari, neither Muslim nor al-Tirmidhi would have made one step here nor there, and without Zayn al-Din al-`Iraqi, Ibn Hajar al-`Asqalani would have gone nowhere.
Abu Dawud was a student of Imam Ahmad whose madhhab he followed.
Al-Nasa'i was without doubt a Shafi`i.
I do not know the madhhab of Imam Ibn Majah.
As anyone can see, it is meaningless to simply say of the above scholars that they were of the vague "school of ahl al-Hadith" as that purported school no more existed, as a unit, than the vague "school of ahl al-Ra'y".
Those appellations split into infinite varieties and branches between each major imam and the next, whereas the eponymous Schools - such as the fiqh of each Sahabi, that of each Tabi`i, that of the Four Imams and their contemporaries - do show internal cohesiveness in method and terminology.
What is true and accurate is that the Two Shaykhs and the compilers of the Sunan were "Ahl al-Hadith" because they focussed _primarily_ on hadith and its sciences, whereas their counterpart, Ahl al-Ra'y - such as Imams Malik, Abu Hanifa and their students - emphasized jurisprudence over hadith narration.
Imam al-Shafi`i, by the grace of Allah, united with near-perfection the two currents and so did his students such as al-Muzani and Abu Thawr. That is why Ulema such as `Abd al-Rahman ibn al-Mahdi could not find enough words to praise his intelligence; and you will find that the vast majority of the Imams of hadith and hadith masters after his time follow the Shafi`i madhhab, beginning with al-Daraqutni, Ibn Abi Hatim and his father, al-Baghawi, Ibn Khuzayma, Ibn Hibban, al-Khatib, and others. Even al-Tabari, Dawud al-Zahiri, and Ibn Hazm began as Shafi`is. WAllahu a`lam.
PS See also http://sunnah.org/history/Scholars/Default.htm for the biographies of the Four Imams and Imam al-Bukhari.
Blessings and peace on the Prophet , his Family, and all his Companions, and may Allah be well-pleased with their excellent Followers; and the Mujtahid Imams of the past; and the pious, Godwary Ulema; and the righteous Awliya; and our Shuyukh in the Most Distinguished Naqshbandi Path, especially the Imam of Tariqa and Ghawth of creatures Khwaja Baha' al-Din Naqshband, Muhammad al-Uwaysi al-Bukhari; and Sultan al-Awliya', the teacher of our teacher, Sayyidi `Abd Allah al-Fa'iz al-Daghistani; and our beloved Shaykh, the light of our eyes, Mawlana al-Shaykh Muhammad Nazim al-Haqqani; and the rest of our Masters and the Siddiqiyyun. Amin.Hajj Gibril