{"id":17611,"date":"2021-03-08T16:14:30","date_gmt":"2021-03-08T16:14:30","guid":{"rendered":"http:\/\/wiki2.plumserver.com\/?post_type=ht_kb&#038;p=17611"},"modified":"2021-09-21T08:50:14","modified_gmt":"2021-09-21T12:50:14","slug":"amp-iframe-dns-errors","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/docs\/magento-amp\/v2\/troubleshooting\/amp-iframe-dns-error","title":{"rendered":"AMP Iframe DNS Errors"},"content":{"rendered":"\n<h2>&lt;AMP-IFrame&gt; DNS Error &#8211; \u201cDomain.com\u2019s server IP address could not be found.\u201d<\/h2>\n\n\n\n<p>Depending on your browser, users may see the following error message on <a href=\"\/magento-amp\">Magento AMP product pages:<\/a> <span style=\"background: #c6fff6\"><em>&#8220;Domain.com&#8217;s server IP address could not be found&#8221;<\/em><\/span> or this message: <span style=\"background: #c6fff6\"><em>&#8220;Domain.com&#8217;s server DNS address could not be found. ERR_NAME_NOT_RESOLVED&#8221;.<\/em><\/span> But essentially, these are all the same error messages. Please see the screenshot below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"714\" src=\"\/docs\/wp-content\/uploads\/2021\/06\/Screen1_v2-1.png\" alt=\"Screen1 v2.png\" class=\"wp-image-18936\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Screen1_v2-1.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Screen1_v2-1-300x178.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Screen1_v2-1-1024x606.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Screen1_v2-1-768x455.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h2>Issue Description<\/h2>\n\n\n\n<p>When this error occurs, the iframe contents are not displayed. The shopping cart button, along with custom options and configurable options, is missing.<\/p>\n\n\n\n<p>This issue happens due to your website DNS setup and AMP IFRAME limitations.\u00a0<a href=\"https:\/\/amp.dev\/documentation\/components\/amp-iframe\/#usage\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">According to the official AMP.DEV documentation<\/a>,\u00a0<span style=\"background: #c6fff6\"><em>\u201can amp-iframe must not be in the same origin as the container\u201d<\/em><\/span>, which means you cannot load both page content and iframe content from the same origin (e.g., domain name).<\/p>\n\n\n\n<h2>Solution 1 (Recommended)<\/h2>\n\n\n\n<p>The recommended workaround is to load your AMP Iframe content from a different domain or a subdomain. In most cases, the easiest way to solve this issue is to load page content from the main domain and iframe content from the \u201cwww\u201d subdomain.<\/p>\n\n\n\n<p><strong>Example 1:<\/strong><\/p>\n\n\n\n<p>If your main website domain is \u201cdomain.com\u201d, then your AMP Iframe must load from \u201cwww.domain.com\u201d<\/p>\n\n\n\n<p><strong>Example 2:<\/strong><\/p>\n\n\n\n<p>If your main website domain is \u201cwww.domain.com\u201d, then your AMP Iframe must load from \u201cdomain.com\u201d<\/p>\n\n\n\n<p>This setup can be achieved by creating a CNAME DNS record in your hosting panel or DNS service provider.<\/p>\n\n\n\n<h3>Step 1<\/h3>\n\n\n\n<p>Create CNAME DNS record as described above or contact your hosting provider if you need any help creating a new DNS record.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th class=\"has-text-align-center\" data-align=\"center\">Type<\/th><th class=\"has-text-align-center\" data-align=\"center\">Name (Host)<\/th><th class=\"has-text-align-center\" data-align=\"center\">Alias to (Value)<\/th><th class=\"has-text-align-center\" data-align=\"center\">TTL<\/th><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">CNAME Record<\/td><td class=\"has-text-align-center\" data-align=\"center\">www<\/td><td class=\"has-text-align-center\" data-align=\"center\">domain.com<\/td><td class=\"has-text-align-center\" data-align=\"center\">1800<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">* domain.com - is your Magento store domain name.<\/pre>\n\n\n\n<p>Depending on your DNS service provider, it may take from 1hr to 72 hours for DNS changes to be updated across the Internet.<\/p>\n\n\n\n<h3>Step 2<\/h3>\n\n\n\n<p>Now once we have the CNAME record created, we can load the AMP Iframe from a different location than the main domain name. However, most websites have 301\/302 redirects created to forward traffic from domain.com =&gt; www.domain.com or from www.domain.com =&gt; to domain.com. Therefore, we must finetune your 301\/302 redirects to allow AMP-IFrame to load successfully.<\/p>\n\n\n\n<p>Our goal is to make sure that if the main website is accessible via the link:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-http\">https:\/\/www.domain.com<\/code><\/pre><\/div>\n\n\n\n<p>then the AMP Iframe must be accessible on the non-www domain without a redirect, for example:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-http\">https:\/\/domain.com\/ampiframe.php<\/code><\/pre><\/div>\n\n\n\n<p>And the other way around, if the main store URL is non-www, for example:&nbsp;<span style=\"background: #c6fff7\"><em> https:\/\/domain.com<\/em><\/span>, then AMP Iframe must be accessible without redirect on www subdomain, example:&nbsp;<span style=\"background: #c6fff7\"><em>https:\/\/www.domain.com\/ampiframe.php<\/em><\/span><\/p>\n\n\n\n<p>We found two approaches that allow avoiding redirecting requests to the ampiframe.php file<br><\/p>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p><strong>Option 1:<\/strong><\/p>\n\n\n\n<p>You must disable the 301\/302 webserver redirects from &#8220;non-www&#8221; to &#8220;www&#8221; or vice versa and enable the Magento 301\/302 redirects instead. This way\u00a0<strong>ampiframe.php<\/strong>\u00a0will be accessible without redirecting to the main website URL. Please follow this 3 step guide to\u00a0<strong><a href=\"\/docs\/magento-amp\/v2\/troubleshooting\/amp-iframe-options-stuck#solution-1-recommended\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">disable the Apache or Nginx 301\/302 redirects and enable Magento redirects instead<\/a><\/strong>.<\/p>\n\n\n\n<p><br><strong>Option 2:<\/strong><\/p>\n\n\n\n<p>You can\u00a0<strong><a href=\"\/docs\/magento-amp\/v2\/troubleshooting\/amp-iframe-options-stuck#solution-2\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">exclude\u00a0<strong>ampiframe.php<\/strong>\u00a0from redirects<\/a><\/strong>\u00a0and keep your existing webserver 301\/302 redirects in place. This option requires minimum changes on your side and possibly the easiest if you know how to work with webserver redirects.<\/p>\n<\/div><\/div>\n\n\n\n<h3>Solution 1 Summary<\/h3>\n\n\n\n<p>This solution is simple and works for most Magento stores. The majority of stores already have the &#8220;www&#8221; subdomain and 301 redirects enabled. If you do, you only need to make sure that the &#8220;ampiframe.php&#8221; is accessible via a direct link from a secondary location without a redirect, otherwise, you will be getting the DNS error message.<\/p>\n\n\n\n<h2>Solution 2<\/h2>\n\n\n\n<p>If creating a CNAME record as explained in&nbsp;<strong><a href=\"#solution-1-recommended\">Solution 1<\/a><\/strong>&nbsp;is not an option for you, then you can try uploading ampiframe.php file on a different domain. This solution is described in the AMP Project&nbsp;<a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/docs\/spec\/amp-iframe-origin-policy.md#security-impact\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Iframe Origin Policy documentation<\/a>:&nbsp;<span style=\"background: #c6fff7\"><em> \u201cOne can easily circumvent AMP&#8217;s not-same-origin-enforcement through redirects, since only the initial URL is tested.\u201d<\/em><\/span>&nbsp;However, this solution should be only used in rare cases and is not recommended for most stores. This solution is available for&nbsp;<a href=\"\/magento-amp\">Magento AMP Extension v3.x<\/a>&nbsp;and later.<\/p>\n\n\n\n<h3>Step 1<\/h3>\n\n\n\n<p>Upload your&nbsp;<strong>ampiframe.php<\/strong>&nbsp;file to any secondary domain or subdomain (different from your Magento Store domain name). For instance, if your Magento store domain is &#8220;domain.com&#8221;, then you could upload this file to:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-http\">domain2.com\/ampiframe.php<\/code><\/pre><\/div>\n\n\n\n<h3>Step 2<\/h3>\n\n\n\n<p>Go to your AMP Magento Extension configuration and\u00a0<strong><a href=\"\/docs\/magento-amp\/v2\/troubleshooting\/amp-iframe-404-error#step-1\">set the AMP Iframe path<\/a><\/strong>\u00a0field value to an absolute path of\u00a0<strong>ampiframe.php<\/strong>\u00a0on secondary domain or subdomain. Example:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-http\">https:\/\/domain2.com\/ampiframe.php<\/code><\/pre><\/div>\n\n\n\n<ul><li>Please note: SSL must be enabled on secondary domain or subdomain for AMP Iframe to work.<\/li><\/ul>\n\n\n\n<h3>Step 3<\/h3>\n\n\n\n<p>Clear the&nbsp;<a href=\"https:\/\/devdocs.magento.com\/guides\/v2.4\/config-guide\/cli\/config-cli-subcommands-cache.html#config-cli-subcommands-cache-clean\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Magento cache<\/a><\/p>\n\n\n\n<h2>Testing AMP IFrame<\/h2>\n\n\n\n<p>Once you completed the above steps, you can go back to your product pages to test the display of configurable options and the \u201cadd to cart button\u201d. Here is a screenshot of the properly loaded AMP IFRAME in the Magento AMP Product Page template:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"714\" src=\"\/docs\/wp-content\/uploads\/2021\/06\/Amp-iframe-option-1.png\" alt=\"Amp-iframe-option.png\" class=\"wp-image-18937\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-iframe-option-1.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-iframe-option-1-300x178.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-iframe-option-1-1024x606.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-iframe-option-1-768x455.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>&lt;AMP-IFrame&gt; DNS Error &#8211; \u201cDomain.com\u2019s server IP address could not be found.\u201d Depending on your browser, users may see the following error message on Magento AMP product pages: &#8220;Domain.com&#8217;s server IP address could not be found&#8221; or this message: &#8220;Domain.com&#8217;s server DNS address could not be found. ERR_NAME_NOT_RESOLVED&#8221;. But essentially, these are all the same &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/docs\/magento-amp\/v2\/troubleshooting\/amp-iframe-dns-error\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;AMP Iframe DNS Errors&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[105],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.2 (Yoast SEO v17.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>AMP Iframe DNS Errors - Plumrocket Documentation<\/title>\n<meta name=\"description\" content=\"&lt;AMP-IFrame&gt; DNS Error - \u201cDomain.com\u2019s server IP address could not be found.\u201d Depending on your browser, users may see the following error message\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AMP Iframe DNS Errors\" \/>\n<meta property=\"og:description\" content=\"&lt;AMP-IFrame&gt; DNS Error - \u201cDomain.com\u2019s server IP address could not be found.\u201d Depending on your browser, users may see the following error message\" \/>\n<meta property=\"og:url\" content=\"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error\" \/>\n<meta property=\"og:site_name\" content=\"Plumrocket Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-08T16:14:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-21T12:50:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Screen1_v2-1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Plumrocket\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"AMP Iframe DNS Errors - Plumrocket Documentation","description":"&lt;AMP-IFrame&gt; DNS Error - \u201cDomain.com\u2019s server IP address could not be found.\u201d Depending on your browser, users may see the following error message","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error","og_locale":"en_US","og_type":"article","og_title":"AMP Iframe DNS Errors","og_description":"&lt;AMP-IFrame&gt; DNS Error - \u201cDomain.com\u2019s server IP address could not be found.\u201d Depending on your browser, users may see the following error message","og_url":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error","og_site_name":"Plumrocket Documentation","article_published_time":"2021-03-08T16:14:30+00:00","article_modified_time":"2021-09-21T12:50:14+00:00","og_image":[{"url":"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Screen1_v2-1.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Plumrocket","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/plumrocket.com\/docs\/#website","url":"https:\/\/plumrocket.com\/docs\/","name":"Plumrocket Documentation","description":"Extensions docs, troubleshootings etc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/plumrocket.com\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error#primaryimage","inLanguage":"en-US","url":"\/docs\/wp-content\/uploads\/2021\/06\/Screen1_v2-1.png","contentUrl":"\/docs\/wp-content\/uploads\/2021\/06\/Screen1_v2-1.png"},{"@type":"WebPage","@id":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error#webpage","url":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error","name":"AMP Iframe DNS Errors - Plumrocket Documentation","isPartOf":{"@id":"https:\/\/plumrocket.com\/docs\/#website"},"primaryImageOfPage":{"@id":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error#primaryimage"},"datePublished":"2021-03-08T16:14:30+00:00","dateModified":"2021-09-21T12:50:14+00:00","author":{"@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8"},"description":"&lt;AMP-IFrame&gt; DNS Error - \u201cDomain.com\u2019s server IP address could not be found.\u201d Depending on your browser, users may see the following error message","breadcrumb":{"@id":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error"]}]},{"@type":"BreadcrumbList","@id":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-dns-error#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Magento 2 Extensions","item":"https:\/\/plumrocket.com\/magento-extensions"},{"@type":"ListItem","position":2,"name":"Magento 2 AMP","item":"https:\/\/plumrocket.com\/magento-amp"},{"@type":"ListItem","position":3,"name":"Documentation","item":"https:\/\/plumrocket.com\/docs\/magento-amp"},{"@type":"ListItem","position":4,"name":"v2","item":"https:\/\/plumrocket.com\/docs\/magento-amp\/v2"},{"@type":"ListItem","position":5,"name":"Troubleshooting","item":"https:\/\/plumrocket.com\/docs\/magento-amp\/v2\/troubleshooting"},{"@type":"ListItem","position":6,"name":"AMP Iframe DNS Errors"}]},{"@type":"Person","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8","name":"Plumrocket","image":{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","caption":"Plumrocket"}}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/17611"}],"collection":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/comments?post=17611"}],"version-history":[{"count":1,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/17611\/revisions"}],"predecessor-version":[{"id":24182,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/17611\/revisions\/24182"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/media?parent=17611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/categories?post=17611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/tags?post=17611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}