Now that you mention foreign friends it would apply to them also.
However I don't mix with the illegal types as far as I know; I assume their immigration status is ok.
The present requirement to register your accomodation address is to tackle the issue of foreigners living annonymously and thus being a security risk, I think.