Short answer
Dunhuang is the one Silk Road destination where the train does not quite get you there. The town sits on a branch line off the main Lanzhou–Xinjiang corridor, and far more trains stop at Liuyuan and Liuyuan South, about 130 km away, than serve Dunhuang station itself. That last stretch is a road transfer of roughly one and a half to three hours.
From Beijing the total journey is measured in a day or more, not hours. Direct long-distance conventional trains run west and take well over 20 hours; the high-speed network reaches the main line at Lanzhou and Xining, not the Dunhuang branch. A sleeper berth is how this leg is normally done, and soft sleeper is the first class to sell out.
Tickets go on sale 15 days before departure on the 12306 English site and app, which accept foreign passports after identity verification. Because berths on this corridor are limited, book on the day the window opens rather than a few days later.
The geography that shapes this route
Two things explain why the rails behave oddly here. Dunhuang is an oasis town in western Gansu, and the main line from Lanzhou toward Xinjiang passes north of it, not through it. A branch line drops south to Dunhuang station. Trains heading west into Xinjiang do not pass through Dunhuang directly.
The practical result is a choice between a station in town with few services and a station on the main line with many services and a long drive at the end. Most travellers end up mixing the two.
| Station | Where it is | What it means for you |
|---|---|---|
| Dunhuang Railway Station | About 10–12 km east of town, near the airport | City buses run from downtown; the station most people picture when they book to Dunhuang |
| Liuyuan Railway Station | Liuyuan Town, about 130 km northwest of Dunhuang | Served by many long-distance trains; buses outside the station run to Dunhuang and leave when full |
| Liuyuan South (Liuyuannan) | Liuyuan Town, the newer station | The high-speed stop on the Lanzhou–Xinjiang corridor, with its own small road transfer into town |
| Beijing West | Beijing | The usual departure station for trains heading west |
Liuyuan South is the newer and more traveller-friendly of the two Liuyuan stations, and it is where the D-series high-speed trains stop. Buses wait outside. If you are arriving late, a taxi arranged in advance removes the guesswork from a 130 km night drive.
What actually runs, and how long it takes
There is no honest way to give a fixed timetable for this route. Services are long-distance, they are adjusted between seasons, and the pairings change. What follows are the typical figures published for the corridor; confirm your date on the 12306 app or the official channel.
| Approach | Structure | Typical time | Trade-off |
|---|---|---|---|
| Direct conventional | Beijing → Dunhuang area, Z or K train, sleeper berth | Well over 20 hours, often with a next-day arrival | No changes, cheapest berths, a lot of time on board |
| High-speed plus connecting train | Beijing → Lanzhou or Xining by high-speed rail, then west to Liuyuan South | Long day plus a transfer | Faster on the rails, but you change trains and stations |
| Rail to Liuyuan plus road | Any train to Liuyuan or Liuyuan South, then road to Dunhuang | Add 1.5–3 hours | Opens up far more departure choices |
| Fly one way | Flight to Dunhuang airport | A few hours | Limited frequencies, worth comparing on cost as well as time |
For scale: Xi'an to Dunhuang by conventional train runs about 19 to 26.5 hours, and Lanzhou to Dunhuang about 17 to 24 hours. Beijing is further east than both, which is why the direct train is a full day and night rather than an overnight. Anyone describing this as an overnight hop from Beijing is looking at the wrong map.
Seat classes on a journey this long
On the conventional trains the ladder is hard seat, hard sleeper and soft sleeper. Hard seat on a 20-hour trip is not a serious option, whatever the saving. Hard sleeper is an open bay of six berths in three tiers, which is workable for one night and much cheaper. Soft sleeper is a closed four-berth compartment with a door, and on this route it is the difference between arriving able to sightsee and arriving able to sleep through the afternoon.
On the high-speed D and G sets heading west there is no sleeper; the classes are second, first and business. For the Beijing to Lanzhou leg, second class is fine and business class is a large premium for a day seat. Our sleeper guide explains berth numbering and what to bring.
Booking with a foreign passport
The official channel for foreign travellers is the 12306 English site and app, which accept recognised foreign passports once the account passes identity verification.
- Verify identity at homeRegister with the passport details exactly as printed, all given names included. Verification failures are the single most common reason a foreign traveller cannot buy a ticket on day one; a station ticket window can complete it in person.
- Book on the 15-day markSales open 15 days before departure in a daily window that normally runs from 05:00 to 01:00 the next day Beijing time, and close around 30 minutes before departure.
- Decide sleeper or day seat firstOn this corridor the berth type drives the decision more than the departure time. Soft sleeper and lower berths go first; if only upper berths remain, take one rather than swapping to a hard seat.
- Check the station you are landing atLiuyuan and Liuyuan South are separate stations, and neither is Dunhuang. Plan the road transfer at the same time you book the train, not after.
- Carry your passport on boardAt most large stations it is scanned at the gate and acts as your ticket. Keep it accessible rather than buried in a bag in the luggage rack.
The registration sequence and the common verification errors are covered in our 12306 in English walkthrough.
Onward from Dunhuang
Dunhuang works well as a stop on a longer Silk Road run rather than a return trip to Beijing. The published times to the places people pair it with look like this — again, typical figures, not a timetable.
| To | Typical train time |
|---|---|
| Guazhou | About 1.5 hours |
| Liuyuan | About 3 hours |
| Jiayuguan | About 4–8 hours |
| Zhangye | About 13 hours |
| Golmud | About 15 hours |
| Lanzhou | About 17–24 hours |
| Xining | About 20 hours |
The Jiayuguan and Zhangye legs are the natural pairing: Jiayuguan's fort is the western end of the Ming wall, and Zhangye's Danxia landforms are a day trip from town. Both are on the main line, so they are easier rail destinations than Dunhuang is.
Booking the Mogao Caves around your train
The caves are the reason most people come, and they are the one part of this trip that punishes loose planning. Entry is capacity-limited and timed, and the official channel is the only reliable place to secure a slot. In the high season, a slot booked after you arrive is often a slot for a date you are no longer there.
Work backwards: fix the cave entry first, then the train. If the two cannot be reconciled, take the train that arrives the evening before rather than the morning of.
Frequently asked questions
Is there a direct train from Beijing to Dunhuang?
There are direct long-distance conventional trains from Beijing toward Dunhuang, but the trip takes well over a day and the schedules change. The high-speed network reaches the Lanzhou to Xinjiang main line, not the Dunhuang branch line, so the fastest rail route involves a change. Check the current options on the 12306 app or official channel before planning.
Why is Dunhuang awkward to reach by train?
Dunhuang sits on a branch line off the main Lanzhou to Xinjiang corridor. Many more trains stop at Liuyuan and Liuyuan South, about 130 km away, than serve Dunhuang station itself, so a rail trip here usually ends with a road transfer of around one and a half to three hours.
Which Beijing station do trains toward Gansu leave from?
Beijing West is the main departure point for long-distance trains heading west and for the high-speed corridor toward Lanzhou and Xining. Check the station printed on your ticket rather than assuming, since Beijing's stations are far apart.
How long does the journey take?
Count it in days, not hours. Direct conventional trains from the east take well over 20 hours to reach the Dunhuang area; for reference, Xi'an to Dunhuang runs 19 to 26.5 hours and Lanzhou to Dunhuang 17 to 24 hours, and Beijing is further east than both. Exact times should be checked on the 12306 app or official channel.
Is a sleeper berth available?
Yes on the conventional trains, which is how most people do this leg. Soft sleeper is a closed four-berth compartment, hard sleeper an open bay of six. On any journey of this length a sleeper is close to essential, and soft sleeper sells out first.
Can I book with a foreign passport?
Yes. The 12306 English site and app accept recognised foreign passports, and identity verification must be completed before a ticket can be bought. At most large stations the passport itself is read at the gate, so no paper ticket is needed.
How far in advance do tickets go on sale?
Fifteen days before departure, in a daily window that normally runs 05:00 to 01:00 the next day Beijing time, and sales close about 30 minutes before the train leaves. On a route with limited berths, book on the day the window opens.
How do I get from Liuyuan to Dunhuang?
By bus or taxi. Buses wait outside the station and depart when full rather than to a fixed timetable, and the drive is about 130 km, taking roughly one and a half to three hours depending on the vehicle and road conditions. There is also a small local transfer from the bus stop to Liuyuan South station.
Should I fly instead?
For most visitors, yes, at least one way. Dunhuang airport sits about 13 km east of town near the railway station. Frequencies are limited compared with a major city, so check the current schedule rather than assuming a daily service.
Related reading
Most Silk Road itineraries reach Dunhuang from the east, which means the Beijing to Xi'an leg comes first, followed by the long run west along the Hexi Corridor. A full list of the corridors we cover is on the train routes index.
Compiled from China Railway ticketing rules, published corridor summaries for the Lanzhou–Xinjiang line and the Dunhuang branch, and traveller reports on the Liuyuan transfer, cross-checked 30 September 2026. Journey times on this corridor vary widely by service and are adjusted seasonally; where a figure could not be confirmed for both directions it is given as a range and flagged. The departure and arrival shown on the 12306 app or official channel on the day you book is the authoritative version. Confirm Mogao Caves entry through the official booking channel, not through this page.