pengguna agent

What sebuah pengguna agent adalah — header HTTP crawler dan browser gunakan untuk identify themselves, robots.txt token vs. full string, dan cara verify sebuah bot adalah nyata.

Pertama kali diterbitkan: 24 Jun 2026 · Terakhir diperbarui: 3 Agu 2026 · Advanced
Bahasa
2 sinyal bukti di halaman ini

sebuah pengguna agent adalah header HTTP setiap client — browser, crawler, atau bot — mengirim untuk identify itself. Two things get confused: full pengguna-agent *string* di permintaan header, dan pendek pengguna-agent *token* (Googlebot, bingbot, Google-Extended) Anda target di robots.txt. token adalah sebuah substring dari string (RFC 9309); beberapa tokens, like Google-Extended, memiliki no permintaan string di semua. string adalah trivially spoofed — Google says -nya own adalah 'sering spoofed' — so tidak pernah trust ini untuk access control. Verify Googlebot/Bingbot oleh reverse DNS plus sebuah forward lookup, atau terhadap published IP ranges. dan watch gotchas: AdsBot dan Google-Safety ignore `User-agent: *`, versi angka dan wildcards di token line adalah ignored, matching adalah case-insensitive, dan serving berbeda konten untuk sebuah bot UA daripada untuk pengguna adalah cloaking.

TL;DR — sebuah pengguna agent adalah HTTP permintaan header apa pun client mengirim untuk identify itself; ini adalah optional, client-filled metadata, not authenticated identity. -nya nilai adalah pengguna-agent string. Separate dari itu adalah pengguna-agent token (product token) digunakan di robots.txt — RFC 9309 says ini seharusnya menjadi sebuah substring dari string, sebuah strong convention dengan documented exceptions (Google-Extended memiliki no permintaan string di semua). Matching adalah case-insensitive, versi angka/wildcards di token line adalah ignored, paling-spesifik group wins, dan sama-token groups merge tetapi tidak pernah merge dengan *. string adalah trivially spoofed — Google panggilan -nya own “often spoofed” (terjemahan) “sering spoofed” — so verify oleh reverse + forward DNS (behind apa pun proxy/CDN, gunakan nyata client IP) terhadap googlebot.com/google.com/googleusercontent.com untuk Google atau search.msn.com untuk Bing, atau match published IP ranges — dan bahkan sebuah verified permintaan hanya proves sebuah permintaan arrived, not itu halaman adalah terindeks, retrieved, atau digunakan untuk AI training. AdsBot dan Google-Safety ignore User-agent: *. Chrome adalah juga freezing detail out dari browser UA strings (pengguna-Agent reduction); Client Hints adalah structured tetapi opt-di replacement, dan neither substitutes untuk crawler verification. pengguna-agent adaptation dapat menjadi legitimate, tetapi deceptively showing crawler materially berbeda konten dapat menjadi cloaking.

Evidence for this claim HTTP User-Agent is a request field containing product information supplied by the client; it is descriptive text and not proof of identity. Scope: HTTP semantics for User-Agent. Confidence: high · Verified: IETF RFC 9110: User-Agent Evidence for this claim robots.txt User-agent matching is defined by the Robots Exclusion Protocol and controls crawler access, not authentication or general HTTP content negotiation. Scope: RFC 9309 robots matching behavior. Confidence: high · Verified: IETF RFC 9309: Robots Exclusion Protocol

header, string, dan token

Three things, dan keeping them straight adalah sebagian besar dari ini topic.

  • ** header.** User-Agent adalah sebuah HTTP permintaan header. setiap client mengirim ini: Anda browser, curl, sebuah crawler, sebuah bot. Per RFC 9110 ( core HTTP semantics standard), ini adalah sebuah optional field client fills di — client-supplied descriptive metadata, not sebuah authenticated identity server memiliki verified.
  • ** string.** header’s nilai — sebuah freeform line describing software, versi, rendering mesin, dan sometimes OS.
  • ** token.** pendek identifier digunakan di robots.txt User-agent: lines untuk target sebuah crawler — Googlebot, bingbot, Google-Extended.

relationship adalah bagian itu trips people up. RFC 9309 ( formal Robots Exclusion Protocol standard) says token “SHOULD be a substring of the identification string that the crawler sends… in the case of HTTP, the product token SHOULD be a substring in the User-Agent header.” (terjemahan) “seharusnya menjadi sebuah substring dari identification string itu crawler mengirim… di case dari HTTP, product token seharusnya menjadi sebuah substring di pengguna-Agent header.” itu’s sebuah SHOULD, not sebuah MUST — sebuah strong convention standard recommends, not sebuah hard requirement setiap crawler adalah mechanically bound untuk. Google-Extended (below) adalah clearest contoh dari sebuah documented exception untuk ini. Don’t read substring aturan sebagai universal hanya because Google mengikuti ini untuk sebagian besar dari -nya own tokens. token adalah bagian dari string when sebuah provider melakukan supply one; Anda target token di robots.txt dan read string di Anda logs.

Evidence for this claim A robots.txt user-agent line selects a crawler product token, not an arbitrary full HTTP User-Agent string; RFC 9309 says the token should be a substring of the identification string, but this SHOULD-level convention has documented product-specific exceptions and is not authentication. Scope: robots.txt parsing and matching Confidence: high · Verified: Robots Exclusion Protocol

Google’s own framing dari how -nya bot identify themselves adalah berguna here: “Google’s crawlers identify themselves through three things: the HTTP user-agent request header, the source IP address of the request, and the reverse DNS hostname of the source IP.” (terjemahan) “Google’s crawler identify themselves melalui three things: HTTP undefined permintaan header, source IP address dari permintaan, dan reverse DNS hostname dari source IP.” Note itu pengguna-agent adalah hanya one dari three — lainnya two adalah how Anda actually verify ini.

Google-Extended: sebuah token dengan no string

cleanest illustration dari token ≠ string adalah Google-Extended. ini controls whether Google dapat gunakan Anda konten untuk Gemini training dan grounding — dan ini memiliki no dedicated HTTP permintaan pengguna-agent string di semua. crawling itself adalah done dengan existing Googlebot strings; Google-Extended exists hanya sebagai sebuah robots.txt control token. Anda’ll tidak pernah see “Google-Extended” (terjemahan) “Google-Extended” di sebuah permintaan header di Anda logs.

practical consequence: blocking Google-Extended affects hanya AI-training gunakan dari Anda konten — ini melakukan not stop Googlebot dari crawling dan pengindeksan Anda untuk Search. mereka’re separate decisions controlled oleh separate tokens. (untuk broader picture dari bot reading Anda situs, see AI crawler dan crawler.)

Googlebot’s pengguna-agent strings

Googlebot adalah “evergreen” (terjemahan) “evergreen” — ini runs pada sebuah recent versi dari Chrome, dan Chrome versi di -nya string updates periodically (ini memiliki since December 2019). itu’s why versi appears sebagai sebuah W.X.Y.Z placeholder:

Googlebot Smartphone (mobile):

Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

Googlebot desktop:

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/W.X.Y.Z Safari/537.36

Two things untuk internalize. pertama, don’t hardcode versiW.X.Y.Z perubahan, dan matching pada ini akan break. Match stable token Googlebot instead. kedua, Anda dapat’t separate mobile dari desktop di robots.txt. Both variants share one Googlebot token, so sebuah robots.txt aturan applies untuk both.

Google’s crawler tokens

Google runs sebuah whole family dari crawler dan fetchers, setiap dengan -nya own token. ones Anda’ll meet sebagian besar:

crawlerrobots.txt tokenNotes
GooglebotGooglebotSearch, Images, Video, News, menemukan — mobile + desktop share ini token
Googlebot ImageGooglebot-ImageGoogle Images
Googlebot VideoGooglebot-VideoVideo Search
Googlebot NewsGooglebot-Newsmenggunakan various Googlebot strings
Google StoreBotStorebot-GoogleShopping
Google-InspectionToolGoogle-InspectionToolPowers Search testing alat
GoogleOtherGoogleOtherInternal research/fetching
Google-ExtendedGoogle-Extendedrobots.txt-hanya — Gemini training, no permintaan string

dan ones itu break usual aturan — special-case crawler itu ignore User-agent: *:

  • AdsBot (AdsBot-Google) dan AdsBot Mobile (AdsBot-Google-Mobile) — mereka don’t obey wildcard. untuk block them Anda harus name them explicitly.
  • AdSense (Mediapartners-Google) — sama; ignores global *.
  • Google-Safety — digunakan untuk malware/abuse detection; ini ignores robots.txt entirely.

implication adalah one people miss: User-agent: * melakukan not block AdsBot atau Google-Safety. jika Anda “block all bots” (terjemahan) “block semua bot” dengan sebuah wildcard dan assume AdsBot adalah hilang, ini isn’t. (ini adalah exactly jenis dari surprise itu lands sebuah halaman di terindeks though blocked oleh robots.txt territory — see robots.txt untuk full control story.)

Bingbot’s pengguna-agent strings

Bing rebuilt Bingbot’s string di 2022 untuk reflect itu ini renders dengan Microsoft Edge. saat ini strings:

Bingbot desktop:

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) Chrome/W.X.Y.Z Safari/537.36

Bingbot Mobile:

Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)

robots.txt token adalah hanya bingbot. thing untuk watch: post-2022, Bingbot’s string looks almost exactly like sebuah nyata Chrome/Edge browser — satu-satunya tell adalah bingbot/2.0 fragment inside ini. jika Anda memiliki apa pun logic itu filters atau detects bot oleh UA, itu perubahan penting.

How robots.txt actually matches sebuah token

sebuah few aturan govern which group dari aturan sebuah crawler obeys (per Google’s robots.txt spec dan RFC 9309):

  • sebagian besar-spesifik match wins. Google “determines the correct group of rules by finding… the group with the most specific user agent that matches the crawler’s user agent.” (terjemahan) “determines correct group dari aturan oleh finding… group dengan paling spesifik pengguna agent itu matches crawler’s pengguna agent.” sebuah Googlebot group beats sebuah * group untuk Googlebot.
  • sama-token groups merge — tetapi tidak pernah dengan *. Multiple groups naming yang sama agent adalah combined ke one. sebuah spesifik-agent group dan * group adalah not merged; * adalah hanya fallback when nothing spesifik matches.
  • Case-insensitive. Field name dan nilai both — Googlebot, googlebot, GOOGLEBOT adalah equivalent.
  • versi angka dan wildcards di token line adalah ignored. Per Google, “both googlebot/1.2 and googlebot* are equivalent to googlebot.” (terjemahan) “both undefined dan undefined adalah equivalent untuk undefined.” Anda cannot write User-agent: Googlebot* untuk match sebuah family — * there melakukan nothing.

So sebuah User-agent: line takes sebuah token dan matches ini sebagai sebuah plain (case-insensitive) substring dari crawler’s identity — no versi pinning, no wildcards inside ini.

Why Anda dapat’t trust string — dan cara verify

pengguna-agent string adalah freeform text. Anything dapat set ini. One line dari curl akan claim untuk menjadi Googlebot, dan plenty dari alat dan malicious bot melakukan exactly itu untuk slip past blocks. Google says so di -nya own Googlebot docs: “the HTTP user-agent request header used by Googlebot is often spoofed by other crawlers.” (terjemahan) “ HTTP pengguna-agent permintaan header digunakan oleh Googlebot adalah sering spoofed oleh lainnya crawler.” sebagai I’ve put ini di my Googlebot guide, “Many SEO tools and some malicious bots will pretend to be Googlebot. This may allow them to access websites that try to block them.” (terjemahan) “banyak SEO alat dan beberapa malicious bot akan pretend untuk menjadi Googlebot. ini dapat allow them untuk access situs web itu try untuk block them.”

So tidak pernah membuat sebuah access atau konten decision pada string alone. Verify instead.

One prerequisite sebelum either metode: get nyata source IP. jika Anda situs sits behind sebuah reverse proxy, muat balancer, atau CDN, address di Anda default access log dapat menjadi proxy’s IP, not crawler’s — Anda perlu original client IP (biasanya forwarded di sebuah header like X-Forwarded-For, configured correctly di Anda proxy) atau neither verification metode below berarti anything.

metode 1 — reverse + forward DNS (best untuk spot memeriksa). Google’s two langkah:

  1. “Run a reverse DNS lookup on the accessing IP address from your logs, using the host command. Verify that the domain name is either googlebot.com, google.com, or googleusercontent.com.” (terjemahan) “Run sebuah reverse DNS lookup pada accessing IP address dari Anda logs, menggunakan undefined command. Verify itu domain name adalah either undefined, undefined, atau undefined.”
  2. “Run a forward DNS lookup on the domain name retrieved in step 1… Verify that it’s the same as the original accessing IP address from your logs.” (terjemahan) “Run sebuah forward DNS lookup pada domain name retrieved di langkah 1… Verify itu ini adalah yang sama sebagai original accessing IP address dari Anda logs.”

untuk Bingbot, yang sama two-langkah dance, tetapi hostname harus end di search.msn.com (not sebuah Bing-branded domain — sebuah umum surprise). Commands adalah di Scripts tab.

metode 2 — published IP ranges (best di scale). Google doesn’t publish sebuah static allowlist untuk hardcoding (“these IP address ranges can change” (terjemahan) “ini IP address ranges dapat perubahan”), tetapi ini melakukan publish machine-readable CIDR JSON files Anda dapat match terhadap (umum-crawler.json dan broader crawler files). Bing now publishes -nya ranges too. I dibangun sebuah Googlebot IP verification alat untuk exactly ini — paste di IPs dan ini classifies them. Bing Webmaster alat memiliki sebuah dibangun-di “Verify Bingbot” (terjemahan) “Verify Bingbot” alat sebagai well.

DNS adalah better untuk sebuah one-off log periksa; IP-range matching adalah better untuk verifying di volume. gunakan whichever fits — tetapi gunakan one dari them. dan treat both expected hostnames dan range files sebagai saat ini sebagai dari today, not permanent — Google dan Bing memiliki changed ini paths sebelum ( IP-range JSON files moved dan adalah renamed since ini artikel adalah pertama written), so re-periksa live verification doc jika sebuah lookup itu digunakan untuk berfungsi stops matching.

sebuah UA match adalah not proof dari downstream outcomes

bahkan sebuah fully verified permintaan — nyata Googlebot IP, forward-confirmed reverse DNS, everything memeriksa out — hanya proves one thing: itu permintaan reached Anda server. ini adalah tempting untuk round itu up ke sebuah much bigger claim, tetapi setiap dari ini adalah sebuah separate fact requiring separate evidence:

  • permintaan diterima — sebuah permintaan dengan itu pengguna agent hit Anda server. (What log verification actually proves.)
  • Identity confirmed — permintaan really came dari crawler ini claims untuk menjadi. (What reverse DNS / IP-range matching menambahkan pada top.)
  • konten fetched dan rendered — crawler successfully rendered halaman (no errors, no blocked resources). Not guaranteed hanya because sebuah permintaan landed.
  • terindeks — URL dibuat ini ke search indeks. sebuah successful fetch doesn’t guarantee pengindeksan.
  • digunakan untuk retrieval, citation, atau training — untuk AI crawler terutama (Google-Extended, GPTBot, dan rest), sebuah crawl adalah not proof Anda konten adalah retrieved untuk sebuah spesifik jawaban, cited, atau digunakan di model training. itu adalah separate, mostly unobservable langkah downstream dari crawl.

sebuah verified Googlebot hit di Anda logs adalah nyata signal — hanya don’t stretch ini further daripada what ini actually menampilkan.

Web bot Auth: where verification adalah heading

di 2026 Google began experimenting dengan Web bot Auth“an experimental cryptographic protocol used to authenticate requests sent by bots.” (terjemahan) “sebuah experimental cryptographic protocol digunakan untuk authenticate permintaan dikirim oleh bot.” idea adalah untuk “move beyond easily spoofed headers to a verified identity and decouple agent identity from IP addresses.” (terjemahan) “move beyond easily spoofed headers untuk sebuah verified identity dan decouple agent identity dari IP addresses.” bot cryptographically sign mereka permintaan; situs verify signature terhadap Google’s published public keys, dan signed permintaan carry sebuah Signature-Agent header. Google’s own caveat penting: “We don’t sign every request of a particular agent. Be sure that you fall back to the established methods of bot verification.” (terjemahan) “kami don’t sign setiap permintaan dari sebuah particular agent. menjadi sure itu Anda fall back untuk established metode dari bot verification.” So ini adalah additive, not sebuah replacement — reverse DNS dan IP ranges remain Anda baseline today.

browser adalah getting harder untuk parse dari UA string too

Everything above adalah tentang crawler, tetapi yang sama “don’t over-trust the string” (terjemahan) “don’t di atas-trust string” lesson applies untuk browser, dan ini adalah getting stronger. Chrome memiliki telah rolling out pengguna-Agent reduction: freezing atau coarsening bagian dari -nya UA string (full browser versi, OS versi, device model) alih-alih reporting them exactly, so string dapat’t menjadi digunakan untuk fingerprint sebuah spesifik pengguna. Google’s own framing: “The granularity and abundance of detail can lead to user identification. The default availability of this information can lead to covert tracking.” (terjemahan) “ granularity dan abundance dari detail dapat lead untuk pengguna identification. default availability dari ini informasi dapat lead untuk covert tracking.” Practically, itu berarti UA-string parsing untuk exact browser/OS/device versi — analytics, device detection, bug triage — adalah increasingly unreliable dan akan hanya get more so.

replacement Chrome recommends adalah pengguna-Agent Client Hints (UA-CH): structured data browser mengirim hanya when sebuah server explicitly menanyakan untuk ini. rendah-entropy hints (browser brand, major versi, mobile flag) go out oleh default; tinggi-entropy hints (exact versi, platform versi, device model) memerlukan server untuk opt di via sebuah Accept-CH respons header pertama — sebuah explicit negotiation, not sebuah broadcast. Two caveats sebelum Anda lean pada ini: ini adalah sebuah Chrome/Chromium-family mechanism, not something setiap browser mengirim, dan bahkan where ini adalah didukung, “the value may be blank, not returned, or populated with a varying value.” (terjemahan) “ nilai dapat menjadi blank, not dikembalikan, atau populated dengan sebuah varying nilai.” Client Hints solve browser-string masalah; mereka adalah not sebuah crawler-verification mechanism — Google dan Bing masih verify mereka own crawler via DNS dan IP ranges, not Client Hints.

pengguna-agent targeting dan cloaking

tempting move — “detect Googlebot by its UA and serve it something special” (terjemahan) “detect Googlebot oleh -nya UA dan sajikan ini something special” — adalah both technically fragile dan sebuah policy violation.

Fragile, because Google doesn’t crawl dengan one UA. Anda’d memiliki untuk correctly handle Googlebot (mobile dan desktop), Google-InspectionTool, AdsBot, GoogleOther, dan more, dari rotating IPs — practically impossible untuk whitelist cleanly.

sebuah policy violation, because serving berbeda konten untuk sebuah crawler daripada untuk pengguna adalah cloaking: “presenting different content to users and search engines with the intent to manipulate search rankings and mislead users.” (terjemahan) “presenting berbeda konten untuk pengguna dan mesin pencari dengan intent untuk manipulate search rankings dan mislead pengguna.” penalty ranges dari algorithmic demotion untuk full deindexing. Note line: legitimate adaptation (responsive layouts, konten negotiation) adalah fine — ini adalah swapping konten itself antara bot dan pengguna itu crosses ke cloaking.

untuk where pengguna agent sits di bigger pipeline, see crawling ( hub) dan crawler. untuk controlling what itu bot adalah allowed untuk fetch, see robots.txt.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.