The shooting happened at a house in Oranmore Street in the Clonard area.
The victim was rushed to the Royal Victoria Hospital where his condition is described as critical but stable.
Police were alerted to the shooting shortly after 10 pm on Monday.
Detectives have appealed for anyone within information about the shooting to contact them on the non-emergency 101 number.
Police inquiries are continuing but no arrests have been made so far.