{"_id":"is-domain-name","_rev":"4635335","name":"is-domain-name","description":"Validate Domain Names as outlined by RFC 2181","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"emilbay","email":"github@tixz.dk"},{"name":"emilbayes","email":"github@tixz.dk"}],"time":{"modified":"2026-04-10T19:14:43.000Z","created":"2016-07-25T04:49:28.540Z","1.0.1":"2016-07-25T05:08:50.842Z","1.0.0":"2016-07-25T04:49:28.540Z"},"users":{},"author":{"name":"Emil Bay","email":"github@tixz.dk"},"repository":{"type":"git","url":"git+https://github.com/emilbayes/is-domain-name.git"},"versions":{"1.0.1":{"name":"is-domain-name","version":"1.0.1","description":"Validate Domain Names as outlined by RFC 2181","main":"index.js","dependencies":{},"devDependencies":{"tape":"^4.6.0"},"scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git+https://github.com/emilbayes/is-domain-name.git"},"keywords":["is","domain","name","rfc2181","dns","hostname","host"],"author":{"name":"Emil Bay","email":"github@tixz.dk"},"license":"ISC","bugs":{"url":"https://github.com/emilbayes/is-domain-name/issues"},"homepage":"https://github.com/emilbayes/is-domain-name#readme","gitHead":"dfc2cdb11e6cea752dec06745a0af7851a5bffae","_id":"is-domain-name@1.0.1","_shasum":"f6eb33b14a497541dca58335137d4466e0c20da1","_from":".","_npmVersion":"3.10.6","_nodeVersion":"6.3.0","_npmUser":{"name":"emilbay","email":"github@tixz.dk"},"dist":{"shasum":"f6eb33b14a497541dca58335137d4466e0c20da1","size":3177,"noattachment":false,"key":"/is-domain-name/-/is-domain-name-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-domain-name/download/is-domain-name-1.0.1.tgz"},"maintainers":[{"name":"emilbay","email":"github@tixz.dk"},{"name":"emilbayes","email":"github@tixz.dk"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/is-domain-name-1.0.1.tgz_1469423328738_0.5552115952596068"},"directories":{},"publish_time":1469423330842,"_hasShrinkwrap":false,"_cnpm_publish_time":1469423330842,"_cnpmcore_publish_time":"2021-12-16T19:09:48.033Z"},"1.0.0":{"name":"is-domain-name","version":"1.0.0","description":"Validate Domain Names as outlined by RFC 2181","main":"index.js","dependencies":{"tape":"^4.6.0"},"devDependencies":{},"scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git+https://github.com/emilbayes/is-domain-name.git"},"keywords":["is","domain","name","rfc2181","dns","hostname","host"],"author":{"name":"Emil Bay","email":"github@tixz.dk"},"license":"ISC","bugs":{"url":"https://github.com/emilbayes/is-domain-name/issues"},"homepage":"https://github.com/emilbayes/is-domain-name#readme","gitHead":"76245d97e9e49425e804002df1239e7f7cd53bfc","_id":"is-domain-name@1.0.0","_shasum":"fe693fc75e1c5d761ea64ce179932fb8f4b269db","_from":".","_npmVersion":"3.10.6","_nodeVersion":"6.3.0","_npmUser":{"name":"emilbay","email":"github@tixz.dk"},"dist":{"shasum":"fe693fc75e1c5d761ea64ce179932fb8f4b269db","size":3193,"noattachment":false,"key":"/is-domain-name/-/is-domain-name-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-domain-name/download/is-domain-name-1.0.0.tgz"},"maintainers":[{"name":"emilbay","email":"github@tixz.dk"},{"name":"emilbayes","email":"github@tixz.dk"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/is-domain-name-1.0.0.tgz_1469422166606_0.4558402858674526"},"directories":{},"publish_time":1469422168540,"_hasShrinkwrap":false,"_cnpm_publish_time":1469422168540,"_cnpmcore_publish_time":"2021-12-16T19:09:48.246Z"}},"readme":"# `is-domain-name`\n\n> Validate Domain Names as outlined by RFC 2181\n\n\n## Install\n\n```sh\nnpm install is-domain-name\n```\n\n## Usage\n\nDomain names are composed of labels interleaved with a separator (`.`).\nDomain as allowed a total length of 255 chars including separators.\nLabels should be between 1 and 63 octets.\n\nLabels allows domains to form a hierarchy, with the right most label acting\nas the root. The leftmost label is often called the TLD (Top-Level Domain),\nthe 2nd leftmost informally called the domain and any label to the right of\nthose called subdomains.\n\nA common domain with only a single label is `localhost`.\n\nThis module checks the following:\n\n* The domain is no longer than 255 chars\n* The domain is at least 2 chars. Even though `a` is technically allowed, this module does not allow it\n* Labels are between 1 and 63 chars\n* Labels start and end with alpha-numeric chars, allowing dashes in between\n* An optional root dot can be allowed with a flag, eg. `example.com.`\n\n```js\nconst assert = require('assert')\nconst isDomainName = require('is-domain-name')\n\nassert.ok(isDomainName('localhost'))\nassert.notOk(isDomainName('-.-'))\n```\n\n## API\n\n### isDomainName(domainName, rootDot)\n#### domainName\n\nType: `String`\n\n#### rootDot\nType: `Boolean`<br>\nDefault: `false`\n\nWhether or not to validate for a trailing dot, signifying the root\n\n## Related\n\n* [`is-http-url`](http://github.com/emilbayes/is-http-url)\n\n## License\n\n[ISC](LICENSE.md)\n","_attachments":{},"homepage":"https://github.com/emilbayes/is-domain-name#readme","bugs":{"url":"https://github.com/emilbayes/is-domain-name/issues"},"license":"ISC"}