Questions tagged [dns]

Domain Name System (DNS) is a service that provides the resolution of host names to IP addresses. Use the [tag:dns] tag when you are troubleshooting DNS issues, configuring a DNS resolver or server, or are trying to understand DNS's involvement in your situation.

Filter by
Sorted by
Tagged with
391
votes
24answers
545k views

How can I resolve a hostname to an IP address in a Bash script?

What's the most concise way to resolve a hostname to an IP address in a Bash script? I'm using Arch Linux.
268
votes
16answers
811k views

How do I set my DNS when resolv.conf is being overwritten?

Most of the info I see online says to edit /etc/resolv.conf, but any changes I make there just get overridden. $ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by ...
231
votes
12answers
626k views

What DNS servers am I using?

How can I check which DNS server am I using (in Linux)? I am using network manager and a wired connection to my university's LAN. (I am trying to find out why my domain doesn't get resolved)
82
votes
1answer
16k views

Chrome: DNS requests with random DNS names: malware?

Over the years (since 2005), I have seen logs of strange random DNS requests done, on the multiple DNS / BIND servers I have maintained. May 7 12:13:50 1.1.1.1 named[63742]: client 1.1.1.2#24123 (...
75
votes
5answers
86k views

What is the point of sshd “UseDNS” option?

I know what it does, but I don't know why. What attack(s) does it prevent? Is it relevant for all kind of authentication methods? (hostbased, password, publickey, keyboard-interactive ...)
48
votes
7answers
29k views

Can I create override dns similar to writing in /etc/hosts without root access

I want to set a dns record that my browser will use, but I don't have root access, so I can't modify /etc/hosts. I need to do this for testing vhosts with apache, whose dns hasn't yet been set up. I ...
41
votes
2answers
32k views

How to troubleshoot DNS with systemd-resolved?

How would you go about finding the DNS servers used by systemd-resolved, for troubleshooting purposes? Generally I can use dig and test the DNS servers shown in /etc/resolv.conf. (Or windows - ...
37
votes
2answers
45k views

dig vs nslookup

Why do the commands dig and nslookup sometimes print different results? ~$ dig facebook.com ; <<>> DiG 9.9.2-P1 <<>> facebook.com ;; global options: +cmd ;; Got answer: ;; -&...
36
votes
5answers
18k views

How do I generate SSHFP records?

I need to setup SSHFP records in the DNS for my host. I have done some searching but I haven't found any good example. What are SSHFP records? What does SSHFP records look like? How do I create SSHFP ...
32
votes
2answers
59k views

curl --resolve appears to do nothing

The --help output for curl lists a --resolve option, which states --resolve <host:port:address> Force resolve of HOST:PORT to ADDRESS I'm not having any luck getting it to work though. The ...
29
votes
3answers
88k views

How to read the local DNS cache contents?

I know that on Windows I can issue ipconfig /displaydns and I see the local DNS's cache content. How can I list the DNS's cache content in Linux? I would like to get as much as cross-distro solution ...
27
votes
1answer
4k views

Why does Chromium not cache DNS for more than a minute?

I use Chromium and have problems with the DNS not being cached for the time that I would expect. Take the example.com domain. According to the DNS settings, this domain should be cached for another ...
26
votes
5answers
58k views

How to clear DNS cache on DD-WRT

How can I clear the DNS cache in DD-WRT on my router? DD-WRT uses the dnsmasq daemon.
21
votes
5answers
54k views

Iptables to redirect DNS lookup IP and Port

I have discovered that my ISP (verizon) is intercepting all DNS traffic on port 53. Using iptables, I want to redirect all DNS lookup traffic to a specific IP and Port (5353). Any attempt for my ...
19
votes
3answers
18k views

What is the purpose of /etc/hosts?

As I understand it, the hosts file is one of several system facilities that assists in addressing network nodes in a computer network. But what should be inside it? When I install Ubuntu by default ...
19
votes
3answers
215k views

How to flush local DNS cache in CentOS

I'm looking for a way to flush the local DNS cache on a CentOS 6. The system is not running any DNS server or anything, and I wish to let every DNS query go out to the configured nameserver, even for ...
18
votes
3answers
21k views

Is there a way to get the Public DNS address of an instance?

I have a project wherein I need to update configuration files each time an EC2 instance is booted with the Public DNS address of the current instance. I'll be using Perl or Sed for this, so that's ...
18
votes
6answers
12k views

Host lookup that respects /etc/hosts

Utilities like host and dig let you see the IP address corresponding to the host name. There is also the getent utility that can be used to query /etc/hosts or other NSS databases. I am looking for ...
17
votes
3answers
35k views

How to test DNS speed?

I am using google open DNS. How can I measure the speed of a DNS server?
17
votes
2answers
21k views

How to configure systemd-resolved and systemd-networkd to use local DNS server for resolving local domains and remote DNS server for remote domains?

I'm connected to local area network with access to the Internet through gateway. There is DNS server in local network which is capable of resolving hostnames of computers from local network. I would ...
17
votes
1answer
26k views

How to let `named` (bind9) forward certain domains to a different nameserver?

In dnsmasq, it's possible to forward domains to different nameservers. How can I do that in named? server=/foo.com/10.0.10.1 server=/vpn.foo.com/8.8.8.8
16
votes
3answers
3k views

Who reads /etc/resolv.conf?

My Centos 7 server doesn't resolve domain names properly. From what I see, in modern Linux systems /etc/resolv.conf is often generated with dhclient, dnsmasq or Network Manager. Thus I have a ...
16
votes
5answers
30k views

How to log all my DNS queries?

How can I create logs of every DNS query that my computer makes along with the responses it gets?
16
votes
2answers
34k views

Blocking Websites with /etc/hosts

There's a website, www.example.com, that I tried to block myself from accessing because it wastes too much of my time. So I configured my /etc/hosts file. I added the following lines, to block the ...
15
votes
2answers
26k views

What is a “recursive DNS query”? [closed]

Can someone explain in short what "recursive DNS query" means and how it can be considered bad?
15
votes
5answers
66k views

How to set DNS resolver in Fedora using network-manager?

I want to try out Google public DNS. For this I need to change the nameserver address. I know it's in the file /etc/resolv.conf, but whenever I start network-manager, it overwrites the values in that ...
14
votes
2answers
45k views

apache won't restart after adding VirtualHost conf file, why not?

In a CentOS 7 server, I get the following error when I type sudo apachectl restart after I add an include file at the bottom of httpd.conf: Job for httpd.service failed. See 'systemctl status httpd....
14
votes
6answers
108k views

Why can't I ping Google?

I can't ping google.com (unknown host). But I can ping IP addresses. I tried to ping the IP address of Google but it doesn't work. resolv.conf nameserver 8.8.8.8 nameserver 209.139.209.33 ifconfig ...
13
votes
2answers
43k views

alternative to nslookup in rhel7?

nslookup does not come preinstalled in RHEL 7 Beta. I noticed even dig and host was not pre installed. I read couple of links which mentions nslookup is dead/deprecated, so is there an alternative for ...
13
votes
1answer
14k views

How can I override the /etc/hosts file at user level? [duplicate]

Possible Duplicate: Can I create a user-specific hosts file to complement /etc/hosts? In short: I would like to know if it is possible to get a ~/hosts file that could override the /etc/hosts ...
13
votes
1answer
41k views

No domain defined in /etc/resolv.conf

I see more and more servers that have no domain defined in the /etc/resolv.conf file. Only a search entry. In what cases is this setup used ? Are there any cases where it must not be used ? ...
13
votes
4answers
56k views

How to define DNS server in openvpn?

I setup an openvpn server with static key (certificate mode is not usable due to DPI at the national gateway), but I cannot successfully change the DNS automatically after the connection. I searched ...
13
votes
6answers
24k views

Busybox ping IP works, but hostname nslookup fails with “bad address”

I am compiling my own 3.14 kernel. I fear I may have left out some important networking feature to get DNS working. I can't resolve domain names. I can ping my DNS server. I can resolve using that ...
12
votes
3answers
12k views

How to test /etc/hosts

What's the best way to confirm that your /etc/hosts file is mapping a hostname to the correct IP address? Using a tool like dig queries an external DNS directly, bypassing the hosts file.
11
votes
3answers
1k views

Two commands, one pipeline

I need these two commands to be one (so I can pipe them further): dig +nottlid -t any bix.hu | egrep -v "^;;|^;|^$" | sort dig +nottlid -t any www.bix.hu | egrep -v "^;;|^;|^$" | sort I mean I need ...
11
votes
3answers
39k views

No DNS resolution after upgrade from ubuntu 14.04 to 16.04

I upgraded ubuntu 14.04 to ubuntu 16.04 and I have a problem with the internet connection. Specifically, DNS after update stopped working. For debugging purposes I set the only DNS 8.8.8.8, but name ...
11
votes
2answers
21k views

Why dig reports the dns server as 127.0.0.1 when I'm using a external DNS?

I use unbound and usually use openDNS as my DNS server. When I run dig google.com say I get SERVER: 127.0.0.1#53(127.0.0.1). What exactly is this thing listening on port #53? is this unbound or is it ...
11
votes
1answer
18k views

“Fake” DNS for a single host

I am running a bind9 dns server at my home network, serving for all my internal servers in my domain local / 192.168.x.x - one of those, extweb.local 192.168.1.33 is also visible from the internet as ...
11
votes
3answers
6k views

Configuring ssh fingerprints on dns to replace known_hosts fails

The SSHFP records were generated on the ssh server as follows and then added to the zone in bind: $ ssh-keygen -r www.test.us. www.test.us. IN SSHFP 1 1 ad04dfaf343a93beeb939eed1612168f7eadbed7 www....
10
votes
1answer
27k views

Is `dig ptr` a valid way to perform a reverse DNS query?

I know we can use dig -x to perform a reverse DNS query. I have a textbook in front of me that says that both dig ptr and dig -x are valid syntax. dig -x definitely works for me, but I'm not getting ...
10
votes
2answers
9k views

DNS lookups sometimes take 5 seconds

I have a VM running Debian Wheezy on which some hostname lookups take several seconds to complete, even though the resolver replies immediately. Strangely, lookups with getaddrinfo() are affected, ...
10
votes
6answers
36k views

DNS queries not using nscd for caching

I'm trying to use nscd (Nameservices Cache Daemon) to cache DNS locally so I can stop using Bind to do it. I've gotten it started and ntpd seems to attempt to use it. But everything else for hosts ...
10
votes
2answers
9k views

How does DNS name resolution work, in principle?

Right now I'm taking an online course for Linux sysadmin and I was asked a question I just generally don't understand. I know how to search for a name server, if I'm correct at least it's using the ...
10
votes
3answers
12k views

DNS Master vs Slave and Primary vs Secondary

I'm a little confused about the difference between a "secondary name server" and a "slave name server" and a "primary name server" and a "master name server"   I understand that a slave name server ...
10
votes
3answers
24k views

Why doesn't systemd-resolved use my local DNS server?

I'm using a local BIND9 server to host some local dns records. When trying to dig for a local domain name I can't find it if I don't explicitly tell dig to use my local BIND9 server. user@heimdal:~$ ...
10
votes
1answer
321 views

Can a domain be configured to only have secondary DNS nameserver records?

I'm asking if someone can verify if my DNS hosting idea is possible or has any flaws. We would host our own primary DNS server for all zones and configure it to allow zone transfers to a set of IPs ...
10
votes
2answers
9k views

How to automatically fetch new name server on VPN connect

I am running ubuntu xenial 16.04 We are using openvpn to connect to a virtual private cloud. That cloud has it's own DNS server (as does our local route - home or office). When I connect to the VPN ...
10
votes
5answers
92k views

Ubuntu: How to configure DNS servers in /etc/network/interfaces correctly for resolvconf?

All examples I have seen of configurations (/etc/network/interfaces) showed that you configure an interface and then underneath that gave the dns-* lines such as: auto eth0 iface eth0 inet static ...
10
votes
2answers
18k views

avahi-daemon and “.local” domain issues

I have a Ubuntu 16.04 based HTPC/Media Server that's running 24/7. As far as I can remember using an official Ubuntu distro, I've always had issues with the avahi-daemon. The issue is pretty often ...
10
votes
2answers
4k views

What's the “right way” to effect changes in /etc/resolv.conf with /etc/resolv.conf.d in place?

I the old days, resolv.conf was static and you edited it yourself. Later on, the DHCP client would rewrite it, using some static entries and what it got from the DHCP lease. These days, some ...