Shaykh Muhammad ibn ‘Uthaymeen (may Allaah have mercy on him) said:
The basic principle concerning the udhiyah is that it is prescribed for the living, as the Messenger of Allaah (peace and blessings of Allaah be upon him) and his companions used to offer the sacrifice on behalf of themselves and their families. With regard to what some of the common folk think, that the sacrifice may be offered on behalf of the dead, there is no basis for that.
Udhiyah on behalf of the dead may be of three types:
1 – When it is offered on their behalf as well as on behalf of the living, such as when a man offers a sacrifice on behalf of himself and the members of his family, and intends thereby both those who are alive and those who are dead. This is permissible, and the basis of that is the fact that the Prophet (peace and blessings of Allaah be upon him) offered the sacrifice on behalf of himself and the members of his family, some of whom had previously died.
2 – Offering the sacrifice on behalf of the dead in fulfillment of their last wishes (wasaaya). This is obligatory except in the case of one who is unable to do it. The basis for this is the verse in which Allaah says (interpretation of the meaning):
“Then whoever changes the bequest after hearing it, the sin shall be on those who make the change. Truly, Allaah is All-Hearer, All-Knower”
3 – Offering the sacrifice on behalf of the dead voluntarily and independently of the living – such as offering a separate sacrifice on behalf of one's father or mother. This is permissible. The Hanbali fuqaha’ have stated that the reward for that will reach the deceased and benefit him, by analogy with giving charity on behalf of the dead.
But we do not think that singling out the dead for offering a sacrifice on their behalf is part of the Sunnah, because the Prophet (peace and blessings of Allaah be upon him) did not offer a sacrifice specifically on behalf of any of his deceased loved ones. He did not offer a sacrifice on behalf of his paternal uncle Hamzah even though he was one of his dearest relatives, or on behalf of his children who died during his lifetime, who were three married daughters and three sons who died in infancy, or on behalf of his wife Khadeejah who was one of his most beloved wives. And it is not narrated that any of his companions offered a sacrifice on behalf of any of their deceased loved ones.
We also think that what some people do, offering a sacrifice on behalf of a deceased loved one in the first year after his or her death, which they call Udhiyat al-Hufrah (the sacrifice of the grave), and they think that no one else can share the reward of it, is wrong – as is offering a voluntary sacrifice on behalf of their deceased loved ones or in accordance with the will, and not offering a sacrifice on behalf of oneself and one’s family, which some people do. If they knew that when a man offers a sacrifice paid for with his own money on behalf of himself and his family, that includes all the members of his family, both living and dead, then they would not do this.