My basic understanding of DNS cache poisoining is that at some local server the cache is been altered. i.e (some urls will be directed to malicious ip address instead of original). So If I entered the IP address of a website directly I will not be a victim of DNS cache poisoining ??
So If I entered the IP address of a website directly I will not be a victim of DNS cache poisoning ??
This depends on the web server its configuration. Often web server use virtual hosts in order to host multiple domains on the same web server.
Based on the domain name, the content of the web page is routed to the proper content directory for that specific domain.
The generic answer to your question is most likely "no!" because of the above described inner working. The only exception is when one domain is served on a specific IP address. In that case it might be possible.
In order to overcome DNS cache poisoning, one could edit the hosts file where the domain is pointed to a specific IP address. The hosts file lookup is performed before any DNS queries take place.
Please note that when DNS changes are applied to a specific domain, your hosts requires updating as well. Although this will work for some time, it is not the best solution.
The best way to prevent such attacks is to use DNSSEC as it allows you to authenticate DNS messages.