Mariusz,
This is almost always a DNS/name resolution problem. For example the Distribution Server might not know the Agent as the short hostname. In such a scenario, the message that the agent sends back to the Distribution Server saying that it was configured would be ignored.
Though it can be also cam communication issue - generally firewall related... Ensure that 4104/udp and 4105/tcp are opened in both directions between Distribution Server and Agetn
Check DNS from the Distribution Server to the Agent and Agent to Distribution server. (Also from Domain Server to the Agent and Agent to the Domain Server just to be on the safe side). You'll want to ensure that in all directions nslookup and ping -a return consistent results by (short) hostname, FQDN and IP address.
Make sure that camping -n returns properly by (short) hostname, FQDN and IP address.
You'll also want to ensure that camping works in all directions (again, by (short) hostname, FQDN and IP address).
If you still have problems after confirming all of this, please open a ticket with support referencing this thread.
Hope that helps,
Sean