Socket
Socket
Sign inDemoInstall

multicast-dns

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multicast-dns

Low level multicast-dns implementation in pure javascript


Version published
Weekly downloads
11M
decreased by-1.52%
Maintainers
1
Weekly downloads
 
Created

What is multicast-dns?

The multicast-dns npm package allows for low-level network discovery and communication using multicast DNS, which is often used in zero-configuration networking to resolve hostnames to IP addresses within small networks that do not include a local name server.

What are multicast-dns's main functionalities?

Discover services on the local network

This code sets up a multicast DNS instance to listen for responses to queries on the local network. It then sends out a query for the A (address) record for 'brunhilde.local'.

const mdns = require('multicast-dns')();

mdns.on('response', function(response) {
  console.log('Got a response to an mDNS query:', response)
});

mdns.query({
  questions:[{
    name: 'brunhilde.local',
    type: 'A'
  }]
});

Advertise services on the local network

This code listens for mDNS queries and responds with the IP address '192.168.1.5' when a query for 'brunhilde.local' is received.

const mdns = require('multicast-dns')();

mdns.on('query', function(query) {
  if (query.questions[0] && query.questions[0].name === 'brunhilde.local') {
    mdns.respond({
      answers: [{
        name: 'brunhilde.local',
        type: 'A',
        ttl: 300,
        data: '192.168.1.5'
      }]
    })
  }
});

Other packages similar to multicast-dns

Keywords

FAQs

Package last updated on 12 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc