Firstly, if you're connected to Internet, try to change your name. If it doesn't help, navigate to Start > Control Panel > System and Security > Windows Firewall > Allow a program through Windows Firewall and check the box next to DiRT.
After that, from the Advanced Settings select Inbound Rules > New Rule. Check the Port box, click Next, select All local Ports and follow the self-explained steps. Also, make sure that your security program doesn't block the connection. If the error persists, reinstall the game.