Дверь, дрель, сирень, дребедень - feminine
Перстень, конь, огонь - masculine
So you can only refer to a dictionary and remember. The best way to remember the gender of a noun is to associate it...