Short answer
The Prophet ﷺ taught three main protections: memorise the first ten ayahs of Surah al-Kahf, seek refuge from the trial of the Dajjal in every prayer before the salam, and keep far away from him. Knowing his signs also protects you: he is blind in one eye, and Allah is not.
Belief in the Dajjal as a real person who will appear near the end of time is part of Sunni creed. Seeking refuge from his trial in the final sitting of prayer is sunnah, and memorising the opening of Surah al-Kahf for protection from him is recommended (mustahabb).
The four schools agree on this.
Explanation
The Prophet ﷺ said there is no trial from the creation of Adam to the Hour greater than the Dajjal. He will claim to be god and will show wonders by Allah's permission: rain at his command, treasures following him, and a "paradise" and "fire" that are the reverse of what they seem. Every prophet warned his people about him.
The protections the Prophet ﷺ gave are simple:
- Surah al-Kahf. Whoever memorises the first ten ayahs of Surah al-Kahf is protected from the Dajjal. Many Muslims also read the whole surah every Friday.
- The dua in prayer. In the last sitting, before the salam, seek refuge from the punishment of Hell, the punishment of the grave, the trials of life and death, and the evil of the trial of al-Masih al-Dajjal.
- Distance. Whoever hears of the Dajjal should keep far away from him, because people will go to him sure of their faith and end up following him.
- Knowledge. He is blind in one eye, and your Lord is not one-eyed. Hadith also say "kafir" will be written between his eyes, readable by every believer.
He will not enter Makkah or Madinah, which angels will guard. The Dajjal will finally be killed by Isa after his return. The real preparation is a firm grasp of tawheed: a person who knows that Allah is not like His creation will not be fooled by a man who eats, walks and is blind in one eye. More in Dajjal.
The evidence
Sahih Muslim 809
Sahih... مَنْ حَفِظَ عَشْرَ آيَاتٍ مِنْ أَوَّلِ سُورَةِ الْكَهْفِ عُصِمَ مِنَ الدَّجَّالِ ...
"Whoever memorises ten ayahs from the start of Surah al-Kahf will be protected from the Dajjal."
The main protection the Prophet gave against the Dajjal.
Sunan Abi Dawud 4319
Graded sahih... مَنْ سَمِعَ بِالدَّجَّالِ فَلْيَنْأَ عَنْهُ ...
"Whoever hears of the Dajjal, let him keep far away from him."
Teaches avoiding him rather than testing one's faith.
Sahih al-Bukhari 3057
Sahih... إِنَّهُ أَعْوَرُ وَإِنَّ اللَّهَ لَيْسَ بِأَعْوَرَ ...
"He is one-eyed, and Allah is not one-eyed."
Gives a clear sign that exposes his false claim to be god.
Sahih Muslim 2946
Sahih... مَا بَيْنَ خَلْقِ آدَمَ إِلَى قِيَامِ السَّاعَةِ خَلْقٌ أَكْبَرُ مِنَ الدَّجَّالِ ...
"Between the creation of Adam and the coming of the Hour there is no creation (trial) greater than the Dajjal."
Shows how serious his trial is.
Sahih al-Bukhari 1881
Sahih... لَيْسَ مِنْ بَلَدٍ إِلاَّ سَيَطَؤُهُ الدَّجَّالُ إِلاَّ مَكَّةَ وَالْمَدِينَةَ ...
"There is no land the Dajjal will not tread except Makkah and Madinah."
Makkah and Madinah are protected from him.
Where the ruling is recorded
- al-Fiqh al-Akbar (Imam Abu Hanifa), Section on the signs of the Hour. Lists the emergence of the Dajjal as a true sign of the Hour.
- Nur al-Idah with Maraqi al-Falah, Kitab al-Salah, chapter on the sunnahs of prayer. The dua after the tashahhud and salawat in the final sitting is sunnah.
This answer is pending review by the scholars on our team. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.