PageSourceSearch

https://helgesver.re/_next/static/chunks/pages/articles/archive/20…-whois-servers-with-php-5f9e4acf66a775f1.js

js helgesver.re collected 2026-09-25 20:24:28 UTC 23,555 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8144],{3710:(e,n,s)=>{"use strict";s.r(n),s.d(n,{default:()=>l,meta:()=>i});var t=s(37876),a=s(91668),o=s(60011);let i={author:"Helge Sverre",title:"How To Query WHOIS Servers With PHP",date:"2014-05-15",description:"PHP script tutorial for querying WHOIS servers to retrieve domain registration information."},r=e=>(0,t.jsx)(o.T,{meta:i,...e});function c(e){let n={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",span:"span",strong:"strong",...(0,a.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.h2,{id:"what-is-whois",children:[(0,t.jsx)(n.a,{className:"heading-anchor","aria-hidden":!0,tabIndex:"-1",href:"#what-is-whois",children:(0,t.jsx)(n.span,{className:"icon icon-link"})}),"What is WHOIS?"]}),"\n",(0,t.jsx)(n.p,{children:"The WHOIS\xa0protocol is a protocol that is used for querying domain information from various WHOIS Servers."}),"\n",(0,t.jsx)(n.p,{children:"It typically returns a set of information about the domain, like registration and expiration date, as well as some\ninformation about the person that registered the domain name, like \xa0their name, email, phone number and address."}),"\n",(0,t.jsxs)(n.h2,{id:"how-whois-works",children:[(0,t.jsx)(n.a,{className:"heading-anchor","aria-hidden":!0,tabIndex:"-1",href:"#how-whois-works",children:(0,t.jsx)(n.span,{className:"icon icon-link"})}),"How WHOIS Works"]}),"\n",(0,t.jsxs)(n.p,{children:["The WHOIS protocol is so dead simple that even I managed to do it. The official RFC specification (\n",(0,t.jsx)(n.a,{href:"http://tools.ietf.org/html/rfc3912",children:"RFC\xa03912"})," ) pretty much says that all you have to do to query a WHOIS server is to\nconnect to a WHOIS\xa0server on the\xa0 port 43."]}),"\n",(0,t.jsxs)(n.p,{children:['Then send this piece of data "domain.com\xa0',(0,t.jsx)(n.code,{children:"<CR><LF>"}),'".']}),"\n",(0,t.jsxs)(n.p,{children:["You might be wondering what is meant by \xa0",(0,t.jsx)(n.code,{children:"<CR><LF>"}),", It's quite simple really, it means Carriage Return and Line Feed (\n",(0,t.jsx)(n.a,{href:"http://en.wikipedia.org/wiki/Newline",children:"More Information"}),' ), \xa0in PHP this is the equivalent to "\\r\\ " without the\nquotes.']}),"\n",(0,t.jsx)(n.p,{children:"That might have been hard to follow, here is a simpler step by step version:"}),"\n",(0,t.jsxs)(n.p,{children:['1. Connect to WHOIS server on port 43. 2. Send "domain.com ',(0,t.jsx)(n.code,{children:"<CR><LF>"}),'". 3. Receive information and Close connection.']}),"\n",(0,t.jsx)(n.p,{children:"Now the question, how do we do this in code?"}),"\n",(0,t.jsxs)(n.h2,{id:"how-to-query-whois-in-php",children:[(0,t.jsx)(n.a,{className:"heading-anchor","aria-hidden":!0,tabIndex:"-1",href:"#how-to-query-whois-in-php",children:(0,t.jsx)(n.span,{className:"icon icon-link"})}),"How to Query WHOIS in PHP"]}),"\n",(0,t.jsxs)(n.p,{children:["It's quite easy to be honest, here is all we need. ",(0,t.jsx)(n.strong,{children:"Note"}),": For simplicity, this code does not have ANY error checking\nwhatsoever."]}),"\n",(0,t.jsx)(n.pre,{className:"language-php",children:(0,t.jsxs)(n.code,{className:"language-php",children:[(0,t.jsxs)(n.span,{className:"token php language-php",children:[(0,t.jsx)(n.span,{className:"token delimiter important",children:"<?php"}),"\n\n",(0,t.jsx)(n.span,{className:"token comment",children:"// Open a Socket connection to our WHOIS server"}),"\n",(0,t.jsx)(n.span,{className:"token variable",children:"$fp"})," ",(0,t.jsx)(n.span,{className:"token operator",children:"="})," ",(0,t.jsx)(n.span,{className:"token function",children:"fsockopen"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token string double-quoted-string",children:'"whois.verisign-grs.com"'}),(0,t.jsx)(n.span,{className:"token punctuation",children:","})," ",(0,t.jsx)(n.span,{className:"token number",children:"43"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"}),(0,t.jsx)(n.span,{className:"token punctuation",children:";"}),"\n\n",(0,t.jsx)(n.span,{className:"token comment",children:"// The data we're sending"}),"\n",(0,t.jsx)(n.span,{className:"token variable",children:"$out"})," ",(0,t.jsx)(n.span,{className:"token operator",children:"="})," ",(0,t.jsx)(n.span,{className:"token string double-quoted-string",children:'"helgetech.com\\r\\n"'}),(0,t.jsx)(n.span,{className:"token punctuation",children:";"}),"\n\n",(0,t.jsx)(n.span,{className:"token comment",children:"// Send the data"}),"\n",(0,t.jsx)(n.span,{className:"token function",children:"fwrite"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token variable",children:"$fp"}),(0,t.jsx)(n.span,{className:"token punctuation",children:","})," ",(0,t.jsx)(n.span,{className:"token variable",children:"$out"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"}),(0,t.jsx)(n.span,{className:"token punctuation",children:";"}),"\n\n",(0,t.jsx)(n.span,{className:"token comment",children:'// Listen for data and "append" all the bits of information to'}),"\n",(0,t.jsx)(n.span,{className:"token comment",children:"// our result variable until the data stream is finished"}),"\n",(0,t.jsx)(n.span,{className:"token comment",children:'// Simple: "give me all the data and tell me when you\'ve reached the end"'}),"\n",(0,t.jsx)(n.span,{className:"token keyword",children:"while"})," ",(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token operator",children:"!"}),(0,t.jsx)(n.span,{className:"token function",children:"feof"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token variable",children:"$fp"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"})," ",(0,t.jsx)(n.span,{className:"token punctuation",children:"{"}),"\n	",(0,t.jsx)(n.span,{className:"token variable",children:"$whois"})," ",(0,t.jsx)(n.span,{className:"token operator",children:".="})," ",(0,t.jsx)(n.span,{className:"token function",children:"fgets"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token variable",children:"$fp"}),(0,t.jsx)(n.span,{className:"token punctuation",children:","})," ",(0,t.jsx)(n.span,{className:"token number",children:"128"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"}),(0,t.jsx)(n.span,{className:"token punctuation",children:";"}),"\n",(0,t.jsx)(n.span,{className:"token punctuation",children:"}"}),"\n\n",(0,t.jsx)(n.span,{className:"token comment",children:"// Print out the data we've received"}),"\n",(0,t.jsx)(n.span,{className:"token keyword",children:"echo"})," ",(0,t.jsx)(n.span,{className:"token string double-quoted-string",children:'"<pre>"'}),(0,t.jsx)(n.span,{className:"token punctuation",children:";"}),"\n",(0,t.jsx)(n.span,{className:"token keyword",children:"echo"})," ",(0,t.jsx)(n.span,{className:"token variable",children:"$whois"}),(0,t.jsx)(n.span,{className:"token punctuation",children:";"}),"\n",(0,t.jsx)(n.span,{className:"token keyword",children:"echo"})," ",(0,t.jsx)(n.span,{className:"token string double-quoted-string",children:'"</pre>"'}),(0,t.jsx)(n.span,{className:"token punctuation",children:";"}),"\n\n",(0,t.jsx)(n.span,{className:"token comment",children:"// Close the Socket Connection"}),"\n",(0,t.jsx)(n.span,{className:"token function",children:"fclose"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token variable",children:"$fp"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"}),(0,t.jsx)(n.span,{className:"token punctuation",children:";"}),"\n\n",(0,t.jsx)(n.span,{className:"token delimiter important",children:"?>"})]}),"\n"]})}),"\n",(0,t.jsx)(n.p,{children:"First we need to establish a socket connection to our WHOIS server, we do this by using the function\n\xa0fsockopen(hostname, port)"}),"\n",(0,t.jsx)(n.p,{children:'$fp = fsockopen("whois.verisign-grs.com", 43);'}),"\n",(0,t.jsxs)(n.p,{children:["We're going to use it's two first parameters that represents the hostname for the WHOIS server and the port\xa0number, for\n.com domains you can use\xa0",(0,t.jsx)(n.strong,{children:"whois.verisign-grs.com"})," as the WHOIS server, the port should always 43."]}),"\n",(0,t.jsxs)(n.p,{children:["If you wan't to check a different\xa0TLD( .info for instance), please reference the\n",(0,t.jsx)(n.a,{href:"http://www.iana.org/domains/root/db",title:"IANA Database",children:"IANA database"}),"\xa0(click on a TLD, scroll to the bottom, the\nWHOIS\xa0server is listed there)."]}
1),"\n",(0,t.jsx)(n.p,{children:"By setting the function as the value of a variable we're storing it's file handle, this is pretty much an Object that we\ncan use to reference the socket connection later in our code."}),"\n",(0,t.jsx)(n.p,{children:"Now we need to set the data that we want to send to the WHOIS server."}),"\n",(0,t.jsx)(n.p,{children:'// The data we\'re sending $out = "helgetech.com\\r\\ ";'}),"\n",(0,t.jsxs)(n.p,{children:["We assign our\n$out\xa0\xa0variable the value helgetech.com followed by \\r\\ characters (same as \xa0",(0,t.jsx)(n.code,{children:"<CR><LF>"})," ) \xa0 Now we want to send this data, we do this by using the built-in PHP function\xa0fwrite($filehandle,\n$data)\xa0 like this:"]}),"\n",(0,t.jsx)(n.p,{children:"// Send the data fwrite($fp, $out);"}),"\n",(0,t.jsx)(n.p,{children:"The $fh\xa0\xa0variable is called a file handle, as I wrote above this is an object used to reference our socket connections,\nin this context, we're sending data on that socket connection."}),"\n",(0,t.jsx)(n.p,{children:'The second parameter is the data we want to send, which is\xa0"helgetech.com\\r\\ "\xa0.'}),"\n",(0,t.jsx)(n.p,{children:"Now for something slightly more confusing, we need to start listening for the response from the WHOIS server."}),"\n",(0,t.jsx)(n.p,{children:"What we're gonna do is to listen for data from the file handle(socket connection) until it doesn't receive anything\nanymore."}),"\n",(0,t.jsx)(n.p,{children:'// Listen for data and "append" all the bits of information to // our result variable until the data stream is finished\n// Simple: "give me all the data and tell me when you\'ve reached the end"'}),"\n",(0,t.jsx)(n.pre,{className:"language-php",children:(0,t.jsxs)(n.code,{className:"language-php",children:[(0,t.jsx)(n.span,{className:"token keyword",children:"while"})," ",(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token operator",children:"!"}),(0,t.jsx)(n.span,{className:"token function",children:"feof"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token variable",children:"$fp"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"})," ",(0,t.jsx)(n.span,{className:"token punctuation",children:"{"}),"\n	",(0,t.jsx)(n.span,{className:"token variable",children:"$whois"})," ",(0,t.jsx)(n.span,{className:"token operator",children:".="})," ",(0,t.jsx)(n.span,{className:"token function",children:"fgets"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token variable",children:"$fp"}),(0,t.jsx)(n.span,{className:"token punctuation",children:","})," ",(0,t.jsx)(n.span,{className:"token number",children:"128"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"}),(0,t.jsx)(n.span,{className:"token punctuation",children:";"}),"\n",(0,t.jsx)(n.span,{className:"token punctuation",children:"}"}),"\n\nThe ",(0,t.jsx)(n.span,{className:"token function",children:"feof"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token variable",children:"$fh"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"}),"\xa0\xa0",(0,t.jsx)(n.span,{className:"token keyword",children:"function"}),"\xa0checks ",(0,t.jsx)(n.span,{className:"token keyword",children:"for"})," a ",(0,t.jsx)(n.span,{className:"token string double-quoted-string",children:'"end of file"'})," in a file ",(0,t.jsx)(n.span,{className:"token function",children:"pointer"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token keyword",children:"or"})," in our ",(0,t.jsx)(n.span,{className:"token keyword",children:"case"})," a socket connection",(0,t.jsx)(n.span,{className:"token punctuation",children:")"}),(0,t.jsx)(n.span,{className:"token punctuation",children:","})," an end of file\nis pretty much just the end of the file ",(0,t.jsx)(n.span,{className:"token keyword",children:"or"})," stream",(0,t.jsx)(n.span,{className:"token operator",children:"."}),"\n\nSo we will listen ",(0,t.jsx)(n.span,{className:"token keyword",children:"for"})," data until the data stops coming",(0,t.jsx)(n.span,{className:"token punctuation",children:","})," pretty much",(0,t.jsx)(n.span,{className:"token operator",children:"."}),"\n\nIn the ",(0,t.jsx)(n.span,{className:"token keyword",children:"while"})," loop we are appending the data we receive to a variable ",(0,t.jsx)(n.span,{className:"token class-name type-declaration",children:"called"}),"\n",(0,t.jsx)(n.span,{className:"token variable",children:"$whois"}),"\xa0 by appending the returning value from the ",(0,t.jsx)(n.span,{className:"token keyword",children:"function"}),"\xa0",(0,t.jsx)(n.span,{className:"token function-definition function",children:"fgets"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),(0,t.jsx)(n.span,{className:"token variable",children:"$filehandle"}),(0,t.jsx)(n.span,{className:"token punctuation",children:","})," ",(0,t.jsx)(n.span,{className:"token variable",children:"$length"}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"}),"\xa0",(0,t.jsx)(n.span,{className:"token punctuation",children:","})," \xa0according to the ",(0,t.jsx)(n.span,{className:"token constant",children:"PHP"}),"\ndocumentation",(0,t.jsx)(n.span,{className:"token punctuation",children:","})," this ",(0,t.jsx)(n.span,{className:"token keyword",children:"function"})," gets a line from a filehandle at a certain length specified by the second parameter",(0,t.jsx)(n.span,{className:"token operator",children:"."}),"\n\nThis means that every time our ",(0,t.jsx)(n.span,{className:"token keyword",children:"while"})," loop loops",(0,t.jsx)(n.span,{className:"token punctuation",children:","})," the ",(0,t.jsx)(n.span,{className:"token keyword",children:"function"})," it will grab ",(0,t.jsx)(n.span,{className:"token keyword",children:"and"})," ",(0,t.jsx)(n.span,{className:"token keyword",children:"return"})," the next ",(0,t.jsx)(n.span,{className:"token number",children:"128"})," bytes of our socket\nconnection response ",(0,t.jsx)(n.span,{className:"token keyword",children:"and"})," append it to ",(0,t.jsx)(n.span,{className:"token class-name type-declaration",children:"our"})," ",(0,t.jsx)(n.span,{className:"token variable",children:"$whois"}),"\xa0\xa0variable",(0,t.jsx)(n.span,{className:"token operator",children:"."}),"\n\nWhen the ",(0,t.jsx)(n.span,{className:"token keyword",children:"while"})," loop reaches the end of the socket stream",(0,t.jsx)(n.span,{className:"token punctuation",children:","})," it will stop running ",(0,t.jsx)(n.span,{className:"token keyword",children:"and"})," ",(0,t.jsx)(n.span,{className:"token keyword",children:"continue"})," on with our code",(0,t.jsx)(n.span,{className:"token punctuation",children:","})," this is\nwhat we ",(0,t.jsx)(n.span,{className:"token keyword",children:"do"})," next",(0,t.jsx)(n.span,{className:"token punctuation",children:":"}),"\n\n",(0,t.jsx)(n.span,{className:"token comment",children:'// Print out the data we\'ve received echo "<pre>"; echo $whois; echo "</pre>";'}),"\n\nWe want to ",(0,t.jsx)(n.span,{className:"token keyword",children:"print"})," out the ",(0,t.jsx)(n.span,{className:"token class-name type-declaration",children:"variable"})," ",(0,t.jsx)(n.span,{className:"token variable",children:"$whois"}),"\xa0 ",(0,t.jsx)(n.span,{className:"token keyword",children:"and"})," we",(0,t.jsx)(n.span,{className:"token string single-quoted-string",children:"'re going to wrap it in some\n[<pre> tags](http://www.w3schools.com/tags/tag_pre.asp)\xa0so we can see it properly formatted\xa0on our page. Lastly we have\nto close our socket connection:\n\n// Close the Socket Connection fclose($fp);\n\nthe\xa0function fclose($filehandle)\xa0 will close a socket or file that is connected to the $filehandle, This is to avoid\nhaving rogue connections stealing memory and various other nasty things.\n\n## Try it yourself\n\nAnd that is pretty much it, Now you'"}),"ve got your very own ",(0,t.jsx)(n.span,{className:"token constant",children:"WHOIS"})," script made in ",(0,t.jsx)(n.span,{className:"token constant",children:"PHP"}),(0,t.jsx)(n.span,{className:"token punctuation",children:","})," ",(0,t.jsx)(n.span,{className:"token constant",children:"I"})," hope you ",(0,t.jsx)(n.span,{className:"token keyword",children:"try"})," to extend it ",(0,t.jsx)(n.span,{className:"token keyword",children:"and"}),"\nimprove upon the foundation that you",(0,t.jsx)(n.span,{className:"token string single-quoted-string",children:'\'ve learned.\n\nYou can save the code\xa0in a .php file and upload it to\xa0your web host( Check\nout\xa0[WebFaction](http://www.webfaction.com/signup?affiliate=helgesverre "Hosting for Developers"),\xa0read my\n[MDDHosting\xa0review](https://helgesverre.com/blog/mddhosting-review/ "MDDHosting Review")\xa0or learn\n[how to host your site for free](http://helgesverre.com/blog/how-to-host-your-website-for-free-000webhost/ "How to Host Your Website For Free")\nif you don\''}),"t have a web host yet",(0,t.jsx)(n.span,{className:"token operator",children:"."}),(0,t.jsx)(n.span,{className:"token punctuation",children:")"})," ",(0,t.jsx)(n.span,{className:"token keyword",children:"or"})," run it locally with software like\n",(0,t.jsx)(n.span,{className:"token punctuation",children:"["}),(0,t.jsx)(n.span,{className:"token constant",children:"WAMP"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"]"}),(0,t.jsx)(n.span,{className:"token punctuation",children:"("}),"http",(0,t.jsx)(n.span,{className:"token punctuation",children:":"}),(0,t.jsx)(n.span,{className:"token comment",children:"//www.wampserver.com/en/),\xa0[XAMPP](https://www.apachefriends.org/index.html) or whichever\xa0local web server"}),"\nsoftware you prefer",(0,t.jsx)(n.span,{className:"token operator",children:"."}),"\n"]})})]})}function l(e={}){return(0,t.jsx)(r,{...e,children:(0,t.jsx)(c,{...e})})}},60011:(e,n,s)=>{"use strict";s.d(n,{T:()=>j});var t=s(37876),a=s(77328),o=s.n(a),i=s(48230),r=s.n(i),c=s(34824),l=s(91668),h=s(14232);function d({id:e,host:n,repo:a,repoId:o,category:i,categoryId:r,mapping:c,term:l,strict:p,reactionsEnabled:m,emitMetadata:u,inputPosition:x,theme:j,lang:k,loading:N}){let[w,f]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{w||s.e(5485).then(s.bind(s,5485)).then(()=>f(!0))},[]),w?(0,t.jsx)("giscus-widget",{id:e,host:n,repo:a,repoid:o,category:i,categoryid:r,mapping:c,term:l,strict:p,reactionsenabled:m,emitmetadata:u,inputposition:x,theme:j,lang:k,loading:N}):null}let p=new Set(["theme-kde","theme-win95","theme-aqua","theme-y2k","theme-nrk","theme-rema1000","theme-steria","theme-construction"]);function m(){let e=p.has(document.body.className)?"light":"dark",n=`@import url("https://giscus.app/themes/${e}
1.css");.gsc-header{display:none!important;}`;return`data:text/css;base64,${btoa(n)}`}function u(){let[e,n]=(0,h.useState)("dark");return(0,h.useEffect)(()=>{n(m());let e=new MutationObserver(()=>{n(m())});return e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>e.disconnect()},[]),(0,t.jsx)(d,{repo:"HelgeSverre/blog-comments",repoId:"R_kgDOSERevw",category:"Announcements",categoryId:"DIC_kwDOSERev84C6-o_",mapping:"pathname",reactionsEnabled:"0",emitMetadata:"0",inputPosition:"top",theme:e,lang:"en",loading:"lazy"})}let x={pre:function({children:e,...n}){let s=(0,h.useRef)(null),[a,o]=(0,h.useState)(!1),[i,r]=(0,h.useState)(!0),c=async()=>{let e=s.current?.innerText??"";try{if(!navigator.clipboard)return void r(!1);await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch{r(!1)}};return(0,t.jsxs)("div",{className:"code-block",children:[(0,t.jsx)("pre",{ref:s,...n,children:e}),i&&(0,t.jsx)("button",{type:"button",className:"code-block__copy",onClick:c,"aria-label":a?"Copied":"Copy code",children:a?"Copied!":"Copy"})]})}};function j({children:e,meta:n,isRssFeed:s=!1}){let a=(0,c.useRouter)();if(s)return e;let i=n?.slug??function(e){let n=(e?.asPath||"").split("?")[0].split("#")[0],s="/articles/";if(n.startsWith(s))return n.slice(s.length).replace(/\/$/,"")}(a),h=new Date(n.date)<=new Date(2022,1,1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o(),{children:[(0,t.jsx)("title",{children:`${n.title} - Helge Sverre`}),(0,t.jsx)("meta",{name:"description",content:n.description}),(0,t.jsx)("meta",{property:"og:title",content:n.title}),(0,t.jsx)("meta",{property:"og:description",content:n.description}),i&&(0,t.jsx)("meta",{property:"og:image",content:`/og/article-${i}.png`}),(0,t.jsx)("meta",{property:"og:type",content:"article"}),i&&(0,t.jsx)("meta",{property:"og:url",content:`https://helgesver.re/articles/${i}`}),(0,t.jsx)("meta",{property:"article:published_time",content:n.date}),(0,t.jsx)("meta",{property:"article:author",content:"Helge Sverre"})]}),(0,t.jsx)("div",{style:{marginBottom:"8px"},children:(0,t.jsx)(r(),{href:"/articles",style:{color:"#667788",fontSize:"10px"},children:"\xab Back to articles"})}),h&&(0,t.jsxs)("div",{className:"old-post-disclaimer",children:[(0,t.jsx)("b",{children:"Content Notice!"})," This post is really old, and no longer reflects my skill level, views or opinions. It is made available here for archival purposes (it was originally on my old WordPress blog). Keep that in mind when you read the contents within."]}),(0,t.jsx)("div",{className:"content-header",children:n.title}),(0,t.jsx)("div",{style:{color:"#666688",fontSize:"10px",marginTop:"4px",marginBottom:"12px"},children:function(e){if(!e)return"No date";let n=new Date(`${e}T00:00:00Z`);return isNaN(n.getTime())?"Invalid date":n.toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric",timeZone:"UTC"})}(n.date)}),(0,t.jsx)("div",{className:"article-content",children:n.disableCodeCopy?e:(0,t.jsx)(l.x,{components:x,children:e})}),!1!==n.comments&&(0,t.jsx)("div",{id:"comments",style:{marginTop:"24px"},children:(0,t.jsx)(u,{})}),(0,t.jsx)("br",{}),(0,t.jsx)("hr",{}),(0,t.jsx)("div",{style:{marginTop:"8px"},children:(0,t.jsx)(r(),{href:"/articles",style:{color:"#667788",fontSize:"10px"},children:"\xab Back to articles"})}),(0,t.jsx)("br",{})]})}},81403:(e,n,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/articles/archive/2014/05/how-to-query-whois-servers-with-php",function(){return s(3710)}])},91668:(e,n,s)=>{"use strict";s.d(n,{R:()=>i,x:()=>r});var t=s(14232);let a={},o=t.createContext(a);function i(e){let n=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),t.createElement(o.Provider,{value:n},e.children)}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=81403)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.