I'm working on a PHP application. There is a requirement to find IP's by hostname and i have to resort to gethostbynamel for that. Looks like there is no other way.
I was wondering if there are any security implications related to this. I am validating the hostname given as input from end-user by using regular expressions.
I have two options:
- When user submits a form with hostname, validate it and use
- When user submits a form with hostname, validate it store it in database and use cron job which runs
Will there be any difference in the above methods?
Security is top priority for the application.