{"id":240,"date":"2026-01-26T05:04:00","date_gmt":"2026-01-26T05:04:00","guid":{"rendered":"https:\/\/jasveermaan.com\/?p=240"},"modified":"2026-03-13T10:06:20","modified_gmt":"2026-03-13T10:06:20","slug":"fixing-illegal-server-name-error-in-burp-suite-caused-by-underscores-in-domain-names","status":"publish","type":"post","link":"https:\/\/jasveermaan.com\/index.php\/2026\/01\/26\/fixing-illegal-server-name-error-in-burp-suite-caused-by-underscores-in-domain-names\/","title":{"rendered":"Fixing \u201cIllegal Server Name\u201d Error in Burp Suite Caused by Underscores in Domain Names"},"content":{"rendered":"\n<p>During a recent web application penetration test, I encountered an unusual issue when proxying traffic through Burp Suite. Every time I attempted to access the target application via Burp, the request failed with the following error:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u201cIllegal server name, type=host_name(0), name=SNIP, value={SNIP}\u201d<\/pre>\n\n\n\n<p>The figure below shows the exact error message returned by Burp Suite.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"3254\" height=\"412\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2026\/01\/BurpSuiteError.png\" alt=\"\" class=\"wp-image-242\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote has-small-font-size is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Note: The actual domain name has been redacted due to NDA restrictions. However, a similar example domain will be used throughout this post to clearly explain the issue and solution.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">How the Issue Appeared<\/h2>\n\n\n\n<p>When accessing the application through a browser configured to use Burp Suite as a proxy, the page failed to load. Instead, the browser displayed an error indicating that the connection could not be established.<\/p>\n\n\n\n<p>The figure below shows the error displayed in the web browser when traffic was proxied through Burp Suite.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"3264\" height=\"1488\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2026\/01\/Browser_Error.png\" alt=\"\" class=\"wp-image-243\"\/><\/figure>\n\n\n\n<p>Interestingly, when the same application was accessed without Burp Suite (direct connection), it loaded perfectly fine. This confirmed that the issue was not with the application itself, but specifically with how Burp Suite was handling the hostname.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2548\" height=\"1002\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2026\/01\/WebWorksWithoutBurp.png\" alt=\"\" class=\"wp-image-246\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Root Cause Analysis<\/h2>\n\n\n\n<p>After some investigation, I discovered that the problem was caused by the use of underscores in the domain name.<\/p>\n\n\n\n<p>According to DNS standards, underscores are not valid characters in hostnames. While many browsers and applications still tolerate them, Burp Suite enforces stricter validation and rejects such domain names.<\/p>\n\n\n\n<p>For example, consider the following domain:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2026_Test_jasveermaan.com<\/pre>\n\n\n\n<p>This domain contains underscores, which Burp Suite treats as invalid, resulting in the \u201cIllegal server name\u201d error.<\/p>\n\n\n\n<p>To continue testing the application through Burp Suite, a workaround was required that would allow Burp to process the domain correctly without modifying the target infrastructure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Workaround Solution<\/h2>\n\n\n\n<p>The solution involves two main steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Creating a custom DNS override in Burp Suite<\/li>\n\n\n\n<li>Using Match and Replace to rewrite the hostname in HTTP requests<\/li>\n<\/ul>\n\n\n\n<p>Let\u2019s go through the steps in detail.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Resolve the Original Domain to an IP Address<\/h3>\n\n\n\n<p>First, we need to determine the IP address associated with the original domain name. This can be done using the nslookup command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nslookup &lt;domain&gt;<br>nslookup 2026_Test_jasveermaan.com<\/pre>\n\n\n\n<p>The figure below shows a successful nslookup result, returning the target IP address:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2998\" height=\"832\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2026\/01\/nslookup.png\" alt=\"\" class=\"wp-image-241\"\/><\/figure>\n\n\n\n<p>Make note of the IP address, as it will be required in the next step.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Configure Burp Suite DNS Override<\/h3>\n\n\n\n<p>Since Burp Suite does not accept underscores in hostnames, we need to provide Burp with a modified version of the hostname that replaces underscores with dots.<\/p>\n\n\n\n<p>Original domain:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2026_Test_jasveermaan.com<\/pre>\n\n\n\n<p>Modified domain:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2026.Test.jasveermaan.com<\/pre>\n\n\n\n<p>To implement this in Burp Suite:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to Settings \u2192 Network \u2192 DNS<\/li>\n\n\n\n<li>Locate the section Hostname Resolution Overrides<\/li>\n\n\n\n<li>Add a new entry:\n<ul class=\"wp-block-list\">\n<li>Hostname: 2026.Test.jasveermaan.com<\/li>\n\n\n\n<li>IP Address: (IP from nslookup)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>The figure below shows the DNS override configuration in Burp Suite:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2424\" height=\"1574\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2026\/01\/Burp-DNS-Config.png\" alt=\"\" class=\"wp-image-244\"\/><\/figure>\n\n\n\n<p>At this stage, Burp Suite will resolve the modified hostname correctly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Configure Match and Replace Rules<\/h3>\n\n\n\n<p>Although DNS resolution now works, the browser will still send HTTP requests using the modified dot-based hostname. However, the backend application expects the original underscore-based hostname in the HTTP Host header.<\/p>\n\n\n\n<p>To resolve this, we configure Burp Suite to automatically rewrite the hostname before forwarding requests to the server. Navigate to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Settings \u2192 Proxy \u2192 Match and Replace<\/li>\n<\/ul>\n\n\n\n<p>Create the following rule:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Type: Request header<\/li>\n\n\n\n<li>Match: 2026.Test.jasveermaan.com (DNS Entry &amp; URL that will be accessed via browser)<\/li>\n\n\n\n<li>Replace: 2026_Test_jasveermaan.com<\/li>\n<\/ul>\n\n\n\n<p>This ensures that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The browser uses a valid hostname (with dots)<\/li>\n\n\n\n<li>Burp Suite can resolve the hostname correctly<\/li>\n\n\n\n<li>The request forwarded to the server still contains the original underscore-based hostname<\/li>\n<\/ul>\n\n\n\n<p>The figure below shows the Match and Replace configuration:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2400\" height=\"1330\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2026\/01\/BurpMatchReplace.png\" alt=\"\" class=\"wp-image-245\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Final Result<\/h2>\n\n\n\n<p>After configuring both DNS overrides and Match and Replace rules, I launched the application again using Burp Suite\u2019s built-in Chromium browser.<\/p>\n\n\n\n<p>Instead of accessing:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2026_Test_jasveermaan.com<\/pre>\n\n\n\n<p>I accessed:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2026.Test.jasveermaan.com<\/pre>\n\n\n\n<p>Thanks to the configured rules, Burp Suite seamlessly:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Resolved the modified hostname<\/li>\n\n\n\n<li>Rewrote the HTTP headers back to the original format<\/li>\n\n\n\n<li>Successfully proxied all client-server communication<\/li>\n<\/ul>\n\n\n\n<p>The figure below shows Burp Suite successfully intercepting traffic without any errors:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2608\" height=\"1288\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2026\/01\/BurpSuccess.png\" alt=\"\" class=\"wp-image-247\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>This issue is relatively rare but can occur when testing legacy applications or environments where underscores are used in domain names.<\/p>\n\n\n\n<p>While browsers may tolerate such domains, Burp Suite adheres strictly to hostname standards and rejects them.<\/p>\n\n\n\n<p>By leveraging Burp Suite\u2019s:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>DNS Hostname Resolution Overrides<\/li>\n\n\n\n<li>Match and Replace functionality<\/li>\n<\/ul>\n\n\n\n<p>we can effectively bypass this limitation and continue testing without requiring any changes to the target application.<\/p>\n\n\n\n<p>I hope this guide helps anyone who encounters a similar issue during a penetration test.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During a recent web application penetration test, I encountered an unusual issue when proxying traffic through Burp Suite. Every time I attempted to access the target application via Burp, the request failed with the following error: \u201cIllegal server name, type=host_name(0), name=SNIP, value={SNIP}\u201d The figure below shows the exact error message returned by Burp Suite. Note: &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jasveermaan.com\/index.php\/2026\/01\/26\/fixing-illegal-server-name-error-in-burp-suite-caused-by-underscores-in-domain-names\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fixing \u201cIllegal Server Name\u201d Error in Burp Suite Caused by Underscores in Domain Names&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-240","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/posts\/240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":4,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":251,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/posts\/240\/revisions\/251"}],"wp:attachment":[{"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}