´It was narrated from 'Umar that:` the Messenger of Allah ruled that the child belonged to the bed.
Explanation & Benefits
Maulana Ataullah Sajid
Benefit:
By "the one who owns the bed" is meant a woman's husband or the owner of a female slave.
The child will be counted as belonging to him, and matters such as inheritance, etc., will also be connected to him, not to the man with whom the illegitimate relationship resulted in the child's birth.
Source: Commentary on Sunan Ibn Mājah by Mawlānā ‘Atā’ullāh Sājid, Page: 2005