Offensive IDFKs can be taken from anywhere inside the Penalty Area, except that they can't be taken from inside the Goal Area. For offences inside the GA, the kick is taken from the nearest point on the line which runs parallel to the Goal Line
Defenders (not 10 yards way) must be on the GL between the posts
Defensive free kicks can be taken from anywhere inside their GA
Coincidentally, I reffed my son't team yesterday (U10) and game them an IDFK inside the PA for ball kicked to keeper and handled
My lad immediately got the ball and took the kick without hesitation. He completely messed it up but he was so quick that it was entirely fair!
As a referee, I'm always surprised that adult teams rarely take quick FKs