The closest capital city is Adelaide, South Australia. the distance is about 500 miles.
The closest major city to Ayers rock is Alice Springs, Australia. Ayers Rock known as Uluru is the largest sandstone rock formation in the southern part of the Northern territory in Austrailia. Located almost in Central Australia if you looked at a map. It Lies approx 208mi or 335kilometers, south west of Alice Springs. It is approx 280mi or 450 Kilometers by car.
The closest city to Ayres Rock is Alice Springs, around 450km away (see link, below).
Good luck!... :-D