Reid  Rohan

Reid Rohan

1647486120

Multicast-dns: Low level multicast-dns implementation

multicast-dns

Low level multicast-dns implementation in pure javascript

npm install multicast-dns

Usage

var mdns = require('multicast-dns')()

mdns.on('response', function(response) {
  console.log('got a response packet:', response)
})

mdns.on('query', function(query) {
  console.log('got a query packet:', query)
})

// lets query for an A record for 'brunhilde.local'
mdns.query({
  questions:[{
    name: 'brunhilde.local',
    type: 'A'
  }]
})

Running the above (change brunhilde.local to your-own-hostname.local) will print an echo of the query packet first

got a query packet: { type: 'query',
  questions: [ { name: 'brunhilde.local', type: 'A', class: 1 } ],
  answers: [],
  authorities: [],
  additionals: [] }

And then a response packet

got a response packet: { type: 'response',
  questions: [],
  answers:
   [ { name: 'brunhilde.local',
       type: 'A',
       class: 'IN',
       ttl: 120,
       flush: true,
       data: '192.168.1.5' } ],
  authorities: [],
  additionals:
   [ { name: 'brunhilde.local',
       type: 'A',
       class: 'IN',
       ttl: 120,
       flush: true,
       data: '192.168.1.5' },
     { name: 'brunhilde.local',
       type: 'AAAA',
       class: 'IN',
       ttl: 120,
       flush: true,
       data: 'fe80::5ef9:38ff:fe8c:ceaa' } ] }

CLI

npm install -g multicast-dns
multicast-dns brunhilde.local
> 192.168.1.1

API

A packet has the following format

{
  questions: [{
    name: 'brunhilde.local',
    type: 'A'
  }],
  answers: [{
    name: 'brunhilde.local',
    type: 'A',
    ttl: seconds,
    data: (record type specific data)
  }],
  additionals: [
    (same format as answers)
  ],
  authorities: [
    (same format as answers)
  ]
}

Currently data from SRV, A, PTR, TXT, AAAA and HINFO records is passed

mdns = multicastdns([options])

Creates a new mdns instance. Options can contain the following

{
  multicast: true // use udp multicasting
  interface: '192.168.0.2' // explicitly specify a network interface. defaults to all
  port: 5353, // set the udp port
  ip: '224.0.0.251', // set the udp ip
  ttl: 255, // set the multicast ttl
  loopback: true, // receive your own packets
  reuseAddr: true // set the reuseAddr option when creating the socket (requires node >=0.11.13)
}

mdns.on('query', (packet, rinfo))

Emitted when a query packet is received.

mdns.on('query', function(query) {
  if (query.questions[0] && query.questions[0].name === 'brunhilde.local') {
    mdns.respond(someResponse) // see below
  }
})

mdns.on('response', (packet, rinfo))

Emitted when a response packet is received.

The response might not be a response to a query you send as this is the result of someone multicasting a response.

mdns.query(packet, [cb])

Send a dns query. The callback will be called when the packet was sent.

The following shorthands are equivalent

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

mdns.respond(packet, [cb])

Send a dns response. The callback will be called when the packet was sent.

// reply with a SRV and a A record as an answer
mdns.respond({
  answers: [{
    name: 'my-service',
    type: 'SRV',
    data: {
      port: 9999,
      weight: 0,
      priority: 10,
      target: 'my-service.example.com'
    }
  }, {
    name: 'brunhilde.local',
    type: 'A',
    ttl: 300,
    data: '192.168.1.5'
  }]
})

The following shorthands are equivalent

mdns.respond([{name:'brunhilde.local', type:'A', data:'192.158.1.5'}])
mdns.respond({
  answers: [{name:'brunhilde.local', type:'A', data:'192.158.1.5'}]
})

mdns.destroy()

Destroy the mdns instance. Closes the udp socket.

Development

To start hacking on this module you can use this example to get started

git clone git://github.com/mafintosh/multicast-dns.git
npm install
node example.js
node cli.js $(hostname).local

Author: Mafintosh
Source Code: https://github.com/mafintosh/multicast-dns 
License: MIT License

#javascript #network

What is GEEK

Buddha Community

Multicast-dns: Low level multicast-dns implementation

Is Low-code The Future Of Mobile App Development? You Will Be Surprise

Low-code development is a way for businesses to make apps, but it has many other uses. TechAhead helps companies build efficient low-code solutions for their specific business needs. Get in touch with us to optimize your workflow with maximum ROI.

#Low-codeappdevelopment
#Low-codeappdevelopmentcompany
#Low-codedevelopment

Ray  Patel

Ray Patel

1623940860

Way to find out if DNS is down or your instance with python

DNS-PING

Way to find out if DNS is down or your instance.

Problem: At times it happens that DNS provider services of a website URL is down and so to reduce response time by not diagnosing the infrastructure and informing the user to check with DNS provider.

Functionality: Lambda in python pings the URL to be monitored and fetch the response. If the response code is anything other than 200 it triggers CloudWatch event and send SNS to user.

How to Run the Script : Create a Lambda function called “DNS-PING” the run-time version Python 3.6 and above by using the attach code. Creation of the Lambda function will in turn create CloudWatch Logs groups for its logging. Lamda can be call every 5 mins or as per your business requirement.

#network #way to find out if dns is down or your instance with python #python #dns #way to find out if dns is down or your instance #find out if dns

Reid  Rohan

Reid Rohan

1647486120

Multicast-dns: Low level multicast-dns implementation

multicast-dns

Low level multicast-dns implementation in pure javascript

npm install multicast-dns

Usage

var mdns = require('multicast-dns')()

mdns.on('response', function(response) {
  console.log('got a response packet:', response)
})

mdns.on('query', function(query) {
  console.log('got a query packet:', query)
})

// lets query for an A record for 'brunhilde.local'
mdns.query({
  questions:[{
    name: 'brunhilde.local',
    type: 'A'
  }]
})

Running the above (change brunhilde.local to your-own-hostname.local) will print an echo of the query packet first

got a query packet: { type: 'query',
  questions: [ { name: 'brunhilde.local', type: 'A', class: 1 } ],
  answers: [],
  authorities: [],
  additionals: [] }

And then a response packet

got a response packet: { type: 'response',
  questions: [],
  answers:
   [ { name: 'brunhilde.local',
       type: 'A',
       class: 'IN',
       ttl: 120,
       flush: true,
       data: '192.168.1.5' } ],
  authorities: [],
  additionals:
   [ { name: 'brunhilde.local',
       type: 'A',
       class: 'IN',
       ttl: 120,
       flush: true,
       data: '192.168.1.5' },
     { name: 'brunhilde.local',
       type: 'AAAA',
       class: 'IN',
       ttl: 120,
       flush: true,
       data: 'fe80::5ef9:38ff:fe8c:ceaa' } ] }

CLI

npm install -g multicast-dns
multicast-dns brunhilde.local
> 192.168.1.1

API

A packet has the following format

{
  questions: [{
    name: 'brunhilde.local',
    type: 'A'
  }],
  answers: [{
    name: 'brunhilde.local',
    type: 'A',
    ttl: seconds,
    data: (record type specific data)
  }],
  additionals: [
    (same format as answers)
  ],
  authorities: [
    (same format as answers)
  ]
}

Currently data from SRV, A, PTR, TXT, AAAA and HINFO records is passed

mdns = multicastdns([options])

Creates a new mdns instance. Options can contain the following

{
  multicast: true // use udp multicasting
  interface: '192.168.0.2' // explicitly specify a network interface. defaults to all
  port: 5353, // set the udp port
  ip: '224.0.0.251', // set the udp ip
  ttl: 255, // set the multicast ttl
  loopback: true, // receive your own packets
  reuseAddr: true // set the reuseAddr option when creating the socket (requires node >=0.11.13)
}

mdns.on('query', (packet, rinfo))

Emitted when a query packet is received.

mdns.on('query', function(query) {
  if (query.questions[0] && query.questions[0].name === 'brunhilde.local') {
    mdns.respond(someResponse) // see below
  }
})

mdns.on('response', (packet, rinfo))

Emitted when a response packet is received.

The response might not be a response to a query you send as this is the result of someone multicasting a response.

mdns.query(packet, [cb])

Send a dns query. The callback will be called when the packet was sent.

The following shorthands are equivalent

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

mdns.respond(packet, [cb])

Send a dns response. The callback will be called when the packet was sent.

// reply with a SRV and a A record as an answer
mdns.respond({
  answers: [{
    name: 'my-service',
    type: 'SRV',
    data: {
      port: 9999,
      weight: 0,
      priority: 10,
      target: 'my-service.example.com'
    }
  }, {
    name: 'brunhilde.local',
    type: 'A',
    ttl: 300,
    data: '192.168.1.5'
  }]
})

The following shorthands are equivalent

mdns.respond([{name:'brunhilde.local', type:'A', data:'192.158.1.5'}])
mdns.respond({
  answers: [{name:'brunhilde.local', type:'A', data:'192.158.1.5'}]
})

mdns.destroy()

Destroy the mdns instance. Closes the udp socket.

Development

To start hacking on this module you can use this example to get started

git clone git://github.com/mafintosh/multicast-dns.git
npm install
node example.js
node cli.js $(hostname).local

Author: Mafintosh
Source Code: https://github.com/mafintosh/multicast-dns 
License: MIT License

#javascript #network

Mitchel  Carter

Mitchel Carter

1603569600

How to configure external DNS with DigitalOcean DNS extension on Plesk

As a customer-friendly hosting panel, Plesk’s entire architecture and ecosystem are strategically designed to streamline and simplify things for customers. Besides the availability of extensions, the menu empowers clients to self-manage various backend and front-end aspects of their website. One of the very useful extensions in this list is the DigitalOcean DNS extension. In this tutorial, we will learn how to configure an external DNS server quickly and safely with Plesk.

There are good chances that, as a genuine netizen, Domain Name Service shouldn’t be an alien word for you. But sharing more knowledge never hurts. So, let’s dig deeper into this before coming to the main topic.

DNS described in simple language

Think of DNS as a translator between you and the computer. DNS or Domain Name Server converts the simple English names like www.google.com into “computer language” of numerical codes.

This process of changing general domain names into computer language is called Resolving. The entity/agent that obtains the IP address by communicating with other servers is called DNS resolver. Loaded with sophisticated capabilities, Plesk can work as a reliable and competent DNS resolver.

Here is the USPs of Plesk as a DNS server resolver

  • It can act as a backup server
  • Quick and direct translation services
  • Facility to handle translation services on a remote server

How does DNS work?

A specific storage space containing specific domain addresses either in a file or an authorized server is called domain zones. There are two types of DNS servers – Root DNS servers and secondary DNS servers, commonly known as lower-level DNS servers.

Root DNS servers refer to a hierarchically arranged global storage system containing the entire DNS database and corresponding IP addresses for all domain names. When the requesting browser attempts to access, say www.myexample.com it requests the authorized server to get the corresponding IP address.

Next level DNS servers store partial DNS databases. These servers are owned by business entities or ISPs who have registered their computers on the DNS system. They run the DNS server software to initiate and manage the DNS resolution process. Each DNS server comes with a public IP as well as vital databases of other hosts including their network names and addresses.

The visitor enters the desired domain name in the address bar and hits enter. It initiates the communication between visitors’ system and DNS server. Acting as a DNS client the web browser requests DNS data from a DNS server which is run by the user’s Internet service provider. Acting on the request the server looks into the internal DNS database to find a matching IP address.

In case if the server fails to find the match it forwards the request to another secondary DNS server in the network. If the matching IP is not found there the request is then escalated to the root server containing the global DNS database. After getting the domain name and corresponding IP the data is returned to the web browser through the route of DNS network. This is known as forward DNS. There is another process known as reverse DNS but that is beyond the scope of this article. You can read about it here.

Delegating DNS zone responsibilities

As a domain name client, you can either allow your registrar to handle the DNS zone responsibilities or delegate it to Plesk. The latter option enables you to self manage your domain zone through your Plesk interface.

Just like most of us techies, DNS is also a multi-tasker. Along with translating domain names into IP addresses, it also delivers other vital data like information related to mail domain, IP validity status, etc.

Configure an external DNS server quickly and safely with Plesk

By default the Plesk works as a master DNS server for the hosted website, i.e., other DNS servers can directly transfer their zones file from it. You also have the option to use the third party DNS servers. In this guide, we present the step by step instructions on how to install a digital ocean DNS extension on Plesk.

  • Go to the Plesk Extensions Catalog.
  • Search for DigitalOcean DNS and click “Install on my server”
  • Open the extension.
  • It opens the page presenting two options for installation namely “0Auth Authentication” and “API token”

configure an external DNS server quickly and safely with Plesk - Plesk

Setting up your DigitalOcean DNS using Plesk Extension with API Token

Click on “API Token.” You would be prompted to enter a token. To generate the token, log into your digital ocean account and click API (left bottom). Click on “Generate a new token”. Enter your desired token name in the resultant dialogue box and click the button below it. You would see the details of the generated token. Copy the code.

Next, go to the Plesk tab, paste code in the box, and click the button below it. On the next screen, you can confirm that the digital ocean extensions have been connected. Click on the option “Activate all” and the extension will be active on all the connected domains.

#product and technology #tips and easy-reading #0auth authentication #api token #clouds #digitalocean #digitalocean dns #dns #dns servers #plesk extensions #tutorial

Brain  Crist

Brain Crist

1594670400

COVID-19 Has Changed the Future of Low-Code. Are You Ready?

How can we turbo-charge growth for the modern business? A hint: ride on the coattails of low-code software development and bridge the digital gap.

Given the benefits of rapid development - lower costs, faster delivery, and greater accessibility - the low-code market is pushing forward to a digital revolution and is projected to reach $27.23 billion in the year 2022. But for those with an eye for faster development cycles will know, today’s leading platforms - such as OutSystemsMendixLinx - were offering rapid development tools from as early as the naughties.

Since then, there has been no looking back.

But before we get to 2022, we need to understand 2020 - the year of Coronavirus - which has ushered in a new reality: Being an adaptable, the digital enterprise has never been more critical. So, how do we adapt, and what lies ahead in 2020?

Pushing to Digital Can Affect Positive Change

In this era of digital transformation, the ability to ship products quickly is a precious trait. Embracing the changes in technology and the newest innovations is no longer limited to the high-flying startups in Silicon Valley or Fortune 500s. Today, every company needs to be a technology company in some way.

Specifically for development, we have come to a place where thanks to many libraries and frameworks, what would’ve once taken many developers to build from scratch is now more often than not, replaced by very few IT pros plumbing different things together.

And if this is the trend to follow (efficiency!), it is why we are seeing so many “no-code” or “low-code” solutions popping up all over the place.

The truth is that in 2020, there are increasingly fewer reasons to write code. From small one or two-person businesses to unicorn startups and large multinationals, every company needs a developer or a team of developers to help with scaling digitally. The difference today is the increased demand to deliver products quickly, meaning that developers need a way to move faster. For those willing to break the model of traditional development, the solution can be found in low-code tools.

And the benefits are apparent:

  • **Speed **- Instead of time-consuming code, low-code platforms use visual models, eliminating the need for knowledge of syntax or boilerplate code.
  • **Flexibility **– Solving unique business problems via customization, without being exorbitantly expensive (read: hours writing code), will always prevail.
  • **Automation **– Less time wasted in trying to get things to work, and more time spent in actually getting them done. Win-win.

#software development #application development #digital transformation #software application development #low-code #low-code platform #low code benefits #low code programming