You would need to add that connection string in 3 places on your farm (beware of multiple WFE as these manual changes require manual input in all WFE!) - Central Administration, Web Services and your target Web Application for this to work properly!

To be a tad more precise: web.config of your web application, web.config of your central administration site and web.config of your STS service. I also assume you're using claims based authentication? Please add your connectionstring config as well, I notice your config says "ADTeste" as name, which seems weird.
–
JasperSep 25 '12 at 14:20

I changed the web.config file using the site you mentioned. I still have the same problem, peoplepicker can find users from domain1 but not domain2. Also, my custom login page cannot authenticate more the users from both domains. Dont i have to inform web.config the connection string user and password for domain?
–
Pablo BertrãoSep 26 '12 at 13:43