Questions tagged [hostname]

A hostname is a human-readable nickname that is assigned to a device connected to a computer network and that is used to identify the device.

A hostname is a label that is assigned to a device connected to a computer network and that is used to identify the device in various forms of electronic communication such as the World Wide Web, e-mail or Usenet. Hostnames may be simple names consisting of a single word or phrase, or they may have appended a domain name, which is a name in a Domain Name System (DNS), separated from the host specific label by a period (dot). In the latter form, the hostname is also called a domain name. If the domain name is completely specified including a top-level domain of the Internet, then the hostname is said to be a fully qualified domain name (FQDN).

1162 questions
10
votes
1 answer

HOST_NAME_MAX undefined after include

I don't know why it still says HOST_NAME_MAX is implicit declaration. Instead, I searched the web and do the following to fix it: #include and use MAXHOSTNAMELEN instead of HOST_NAME_MAX however, I am not very sure it this is a good…
yuan
  • 317
  • 1
  • 4
  • 12
9
votes
3 answers

get website ip using php

I need to fetch the given website ip address using php, that is ip address of server in which website is hosted. For that i've used gethostbyname('**example.com*'). It works fine when the site is not redirected. for example if i used this function…
vkGunasekaran
  • 6,668
  • 7
  • 50
  • 59
9
votes
1 answer

How to get the user set computer name using python in MacOS Sierra/High Sierra

The question below has partly been answered, see the Solution section below. So I'm posting this partly to help others and also since the solution I have hasn't really solved the problem yet. Question So, the question is why the hostname as given…
9
votes
4 answers

Failed to start hostname.service: Unit hostname.service is masked

Failed to start hostname.service: Unit hostname.service is masked. This happened after hostname update, tried to do a sudo service hostname start.
warlockdead
  • 131
  • 1
  • 1
  • 8
9
votes
2 answers

Cannot resolve .local hostname after upgrading to macOS Sierra

I recently upgraded to macOS Sierra and i cannot resolve my .local hostnames anymore. I've tried restoring the httpd.conf and httpd-vhosts.conf files, but it didn't help. I can however reach my webserver using the IP address, but not with the .local…
user7014987
  • 101
  • 1
  • 2
9
votes
2 answers

nodejs express: hostname with port from the req object

Sometimes I want to sent a qualified URL in a mail from my node application. Or I would like to set the content of a phantom page object. I get the full URL like this in my deployment setup. 'http://' + req.hostname + '/myapp' However on the…
Dennis Bauszus
  • 1,624
  • 2
  • 19
  • 44
9
votes
5 answers

Java regex for accepting a valid hostname, IPv4, or IPv6 address

Does anyone have a good (preferably tested) regex for accepting only a valid DNS hostname, IPv4, or IPv6 address?
ljbade
  • 4,576
  • 4
  • 30
  • 35
9
votes
2 answers

C++ Windows function call that get local hostname and IP address

Is there built-in windows C++ function call that can get hostname and IP address? Thanks.
Stan
  • 37,207
  • 50
  • 124
  • 185
8
votes
4 answers

I want to use jQuery to get the location and the first folder with window.location

I want to get the location and the first folder, like: http://www.example.com/test/ var $location = window.location.href; alert ($location); this returns http://www.example.com/test/location-test.html So I would like it to return everything up to…
user770252
  • 83
  • 1
  • 5
8
votes
2 answers

Get current domain name from request in Nuxt

How can I get the current domain name from a request on server side? My Nuxt based website is reachable from different domains. I would like to get the domain name from where the user has accessed the website. How can I do this? I tried to write a…
Philipp S.
  • 827
  • 17
  • 41
8
votes
2 answers

Haskell - hostname resolution inside Alpine Docker image does not work

The Issue I am trying to create docker image with the Haskell application inside. however, the domain name resolution of hostnames of other containers in the network in my application inside docker container fails (but I am able to wget / ping other…
carbolymer
  • 1,439
  • 1
  • 15
  • 30
8
votes
2 answers

Is there a unix command to retrieve NS records from domain?

I am looking for a way to get the primary and secondary NS records of a given domain name, and the IP addresses associated with them. Now this kind of information is available from websites like intodns.com, but I am working on a huge list of…
Zenet
  • 6,961
  • 13
  • 38
  • 45
8
votes
2 answers

akka http SSLConfig issues with Hostname verification and cert validation

I have some issues with Akka http configuration on the client side. I am trying to connect to a server which doesn't provide: - a public signed certificate - a certificate corresponding to the hostname I don't have the hand on this nginx so I cannot…
vgkowski
  • 519
  • 6
  • 15
8
votes
1 answer

How to get local host name in C# on a Windows 10 universal app

string machineName = System.Environment.MachineName; This code doesn't work for me, error code 'Environment' does not contain a definition for 'MachineName' I'm using Visual Studio 2015 and Universal App with C# Please also list the namespace I…
Jerry
  • 1,704
  • 5
  • 20
  • 40
8
votes
4 answers

Get host name without using HttpRequest

I want to run a "background job" in my ASP.NET application (periodically, as separate thread). And I need host name (DNS name or IP) to do my tasks. The problem is that the HttpContext.Current may be not available here (it's NULL). Is there any way…
Tadas Šukys
  • 4,140
  • 4
  • 27
  • 32