If Lync 2010 or 2013 have intermitent connection problems , this can be caused by a misconfiguration on your SIP on your Lync Server or an Active Directory misconfiguration.
A workaround is to manually specify the Internal Server Name and the External Server Name with these values on :
Internal Server Name : sipdir.online.lync.com:443
External Server Name : sipdir.online.lync.com:443