This paper proposes a technique to foil DoS (Denial of Service) attacks. The proposed technique converts a static service to a relocating service and provides information of the new location only to the specific pre-registered client groups while hiding it from others. The Nameserver, responsible for advertising the address of the service, publishes only the encrypted address for the service. Only pre-registered clients get the key (needed for decryption), after being authenticated by the Key Server, which is entrusted with the distribution of key(s). A DoS attack becomes difficult to execute, as the attacker does not know the precise location to attack. In addition, the proposed technique facilitates quick restoration of services in the event of an attack. We also show that this solution can be implemented with a low run time overheads.