Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Difference between localhost and 127.0.0.1

Lots of people would think what the address 127.0.0.1 is when first seeing this address. In fact, 127.0.0.1 is a loopback address which refers to the local machine. It is generally used for local testing. When typing ping 127.0.0.1 on local command console, it will send network packets to local IP/TCP layer to test whether IP/TCP works properly or not. To those who are used to use localhost, it is actually mapped to 127.0.0.1 by default. There are hosts files in the system which store this mapping. Hence normally these two can be interchanged.# localhost name resolution is handled within ...

30,170 2       LINUX NETWORK LOCALHOST 127.0.0.1 LOCALHOST VS 127.0.0.1


  Handle NXDomain error when resolving IP address in Ruby DNS resolver

In another post, we covered how to resolve SystemStackError when resolving IP address in Ruby. In this post, we would cover another common issue where a NXDomain error is returned when resolving an IP address. The NXDomain error means that the queried domain name does not exist in the DNS.In Ruby, DNS resolver library will use /etc/resolv.conf by default get the name servers to resolve the domain name. There are multiple DNS name servers can be specified in /etc/resolv.conf with below format.nameserver nameserver nameserver ...By default, only the top MAXNS name servers(3 in Linux by...

4,225 0       RUBY RUBY ON RAILS NETWORK DNS NXDOMAIN


  Resolve SystemStackError issue when resolving IP address in Ruby

In Ruby, Resolv is the default DNS resolution implementation. It can be used to resolve IP address of a hostname. To use it, one just needs to require 'resolv' in the code. But sometimes, a user would want to check /etc/hosts first or some other mechanisms to resolve an IP address. In this case, one can require 'resolv-replace' and then replace the default DNS resolvers with customized DNS resolvers.For example, using resolv-replace, one would writerequire 'resolv-replace'Resolv::DefaultResolver.replace_resolvers([Resolv::Hosts.new, Resolv::DNS.new])Resolv.getaddress 'some-site.com'In this cas...

5,377 0       RUBY RUBY ON RAILS NETWORK


  Configure static IP for Linux

When a Linux server is running, it has to have an IP so that other machines can talk to it. It is often desired that the server would own a static IP so that every time other machines want to connect to it, the same IP address would be used. This is extremely useful when there are virtual machines installed on a host machine where the virtual machine would start and stop now and then. To configure static IP address for a Linux server, the /etc/network/interfaces needs to be updated. Assuming there is a host only network is created for a network interface named eth1. The configuration woul...

2,577 0       LINUX NETWORK DNS STATIC IP


  Create host only network on VirtualBox

Previously we showed how to install Ubuntu in VirtualBox. What if we want to communicate with the host OS from within the Guest OS on VirtualBox? There are a few ways to do this. For example, bridged network, Host only networks. Today we will show you how to enable network communication between host OS and guest OS using host only networks.A host only network will not need to access the physical network interface of the host OS. It will create a network between different virtual machines and the host machine. This is very useful if you want to set up a network of machines which just need to co...

10,667 1       VIRTUALBOX NETWORK VIRTUAL MACHINE HOST-ONLY


  gethostbyname vs getaddrinfo

getaddrinfo is slower than ping when resolving domain names. I think ping uses gethostbyname to resolve a domain name. The question becomes whether getaddrinfo is slower than gethostbyname. After testing with both functions, we find that getaddrinfo is really slow compared to gethostbyname. By strace tracking,  we find getaddrinfo will communicate with DNS server 10 times and gethostbyname will communicate with DNS server communication twice.gethostbyname is an old way to resolve domain name, The disadvantage of it is that it does not support IPV6, so there is a gethostbyname2 which repla...

20,597 0       C++ NETWORK DNS


  Python for the Web

Python is the best language in the world for interacting with the web, and I'm going to show you why.This article will give an extremely high level overview of how to use python for the web. There are many ways you can interact with the web using python, and this post will cover all of them. This includes python web scraping, interacting with APIs (Application Programming Interfaces) and running your own python web site using python server software. There are many ways to do all these things in python, but I'm going to show you how to do it the right way using the most modern te...

2,280 0       INTERACTION WEB PYTHON COMMUNICATION NETWORK