Just to be clear.... "dynamic" is the "D" in DHCP, which is used by everyone from giant corporation, ISPs, all the way down to my little router and can be used with both publicly addressable (internet facing) IP addressing schemes as well as private (reserved) IP addressing.
If you are having trouble with DHCP the fault can be local (on your PC) or can be local (on your router), but most often involves the "private" bit.
You could have issues with TCP/IP or issues with your winsock catalog or some malware or legitimate security suite inhibiting your PC's ability to communicate with your router properly to receive DHCP configuration data, or......
You could have issues with your router's firmware (corrupted or unable to properly forward DNS resolution queries) which may be fixed with a firmware update or testing with another router or different environment to understand what might be going on
The tool that I linked to will perform a lot of things automatically (reset the TCP/IP stack, reset the winsock catalog, reset IE, etc., etc.,) but it will not overcome router firmware issues nor an over zealous third party security suite.
You say...
one day the system crashed and since then the internet wasn't working . Then i had to change IP to static
You do not say, why or how "the system crashed" or what you may have done to recover from that. IF it was an infection or a bad driver then I would look more towards the cause of the crash to address your current issue and try to determine
why static IP addressing seems to work and
why DHCP does not.