Gajnik was formerly part of the German Empire. In the German Empire, the place was called Hain.
The place is now called Gajnik and belongs to Poland.
| Historical place name | Country | Administration | Time |
|---|---|---|---|
| Hain | German Empire | Habelschwerdt | 1939 |
| Gajnik | Under Polish administration | Bystrzyca Kłodzka | 1945 |
| Gajnik | Poland | Wałbrzych | 1992 |