Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS invalid, a9f script in debian lenny on vmware fusion (/etc/hosts = fail) #11

Closed
erutan opened this issue Aug 9, 2010 · 21 comments
Closed

Comments

@erutan
Copy link

erutan commented Aug 9, 2010

I've tried using 127.0.0.1, 127.0.1.1, and the 192.168.x.x that I get when NATed in VMWare Fusion.

hostname -f
hostname -v
hostname -s
hostname -a
hostname -d
uname -n

all show what they should, I've tried using a faux .org as well as .local at the end, and have run

/etc/init.d/hostname.sh start

and

/etc/init.d/networking restart (and/or ifup eth0)

after changes just to make sure they stuck (and have logged in/out).

relevant parts of /etc/hosts

127.0.0.1 localhost
127.0.1.1 aegir.local hq.aegir.local

/etc/hostname

aegir.local

relevant parts my aegir.sh I've copied from the server

_AEGIR_VERSION="HEAD"

_MY_OWNIP="127.0.1.1"
_MY_HOSTN="aegir.local"
_MY_FRONT="hq.aegir.local"
@omega8cc
Copy link
Owner

omega8cc commented Aug 9, 2010

That is pure guessing so far from my side (I didn't test in on any local VM), but what is exactly the result of commands there:

hostname -f

uname -n

And what are the results of commands:

host aegir.local | cut -d: -f2 | awk '{ print $4}'

host hq.aegir.local | cut -d: -f2 | awk '{ print $4}'

@erutan
Copy link
Author

erutan commented Aug 9, 2010

I'll get back to you with those answers - I ended up just cutting out the logic to test for DNS validity and have pushed forward in the script (if it doesn't work then I'll just revert to an earlier snapshot).

I'm relatively new as a sysadmin so it could very well be something I've overlooked in debian and not the script. :)

@omega8cc
Copy link
Owner

omega8cc commented Aug 9, 2010

I'm asking for results from above command in the hope it could show us where/why it fails. It's also possible that your settings in /etc/hosts doesn't work as expected because your /etc/resolv.conf asks for results defined there nameserver and doesn't respect /etc/hosts, however I'm not sure how it can work on the local VM, so I can be completely wrong, we just need to see the results for host/hostname tests first.

@erutan
Copy link
Author

erutan commented Aug 9, 2010

I will definitely get back to you those results, but right now your script is still installing, so I'm going to let it does its thing and see what happens at the end. :)

Off the top of my head:

hostname -f, -v and uname -n were aegir.local
hostname -a was hq.aegir.local
hostname -s was aegir
hostname -d was local

@omega8cc
Copy link
Owner

omega8cc commented Aug 9, 2010

We need only hostname -f and those 2 tests with host command to make sure what is wrong - it can be a problem with your dns setup or bug in the installer logic checks for dns.

@erutan
Copy link
Author

erutan commented Aug 9, 2010

I got a FATAL ERROR: Something went wrong, Aegir is not installed - exit now. yay.

hostname -f, -v and uname -n are aegir.local

re: the host command, it says I must specify a list of bytes, characters, or fields in regards to cut.

update: my resolv.conf contains:

domain localdomain
search localdomain
nameserver 192.168.27.2

@omega8cc
Copy link
Owner

omega8cc commented Aug 9, 2010

Yeah, that was expected. Maybe look for that host command in the code (copy/paste from comments here may include some incorrectly formatted stuff). In any case, this host command has to work if your system is functional. Or just run it as:

host aegir.local

host hq.aegir.local

And paste here the full output.

@erutan
Copy link
Author

erutan commented Aug 9, 2010

Host (hq.)aegir.local not found: 3(NXDOMAIN).

Yet a hostname brings up aegir.local fine, and 'host localdomain' brings up 127.0.0.1.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=118475 - looks like this is expected behaviour.

@omega8cc
Copy link
Owner

omega8cc commented Aug 9, 2010

Your defined hostname has to match your defined IP. It doesn't resolve properly. Try to comment out first 2 lines in /etc/resolv.conf, if that will not help, you don't have working nameserver on 192.168.27.2 so comment out all lines and see if that will allow to resolve your hostname with /etc/hosts only.

@erutan
Copy link
Author

erutan commented Aug 9, 2010

Commenting out the first two lines in /etc/resolv.conf leaves me with the same DNS issue.

Commenting out the nameserver causes everything to fail earlier (it doesn't resolve omega8.cc, etc), so it is working.

It's a vanilla install of Debian aside from emacs, sudo, and your script pretty much.

@omega8cc
Copy link
Owner

omega8cc commented Aug 9, 2010

Put there only two lines then:

nameserver 8.8.8.8

nameserver 8.8.4.4

This should give you remote domains resolved and still allow to use /etc/hosts.

If that doesn't work, we need someone with better understanding of proper dns setup for local VM.

@erutan
Copy link
Author

erutan commented Aug 9, 2010

Google DNS servers don't change anything. On a somewhat tangential note, running ifup eth0 resets my /etc/resolv.conf to default.

from the link I put up above...

host - query nameserver about domain names and zones

"host" is not a tool for querying libc's name service, it's a tool for
querying DNS servers, similar to nslookup. As a result, it should never
touch /etc/hosts. This looks like perfectly sane behaviour to me.

So that could be why I can dig aegir.local and get a response but it doesn't show up in hosts. Your script uses "host", which could be part of the reason my stuff in /etc/hosts isn't showing up... though I still got an error when bypassing your logic and when it came time to install Aegir (though I hadn't manually installed Console_Table in that snapshot yet). host and nslookup don't resolve aegir.local, but ping and dig do.

@erutan
Copy link
Author

erutan commented Aug 10, 2010

from IRC:

erutan: i have a script that checks IP addresses against hostname/FQDN using 'host' - this works fine for prod sites that have dns but afaik 'host' doesn't touch /etc/hosts for resolution (e.g. I can ping/dig test.local but I can't host or nslookup it)... i'm still in the noob stages of debian but what command would work with /etc/hosts/ resolution as well as DNS?

gnarface: i don't know if there's a better way to do this but i do believe that if you set up dnsmasq somewhere and use that as a dns server it will add the /etc/hosts entries to it's answers when queried

erutan: cool - i was thinking about using bind (or perhaps just getting a dyndns.org account and bridging my dev VM)

@erutan
Copy link
Author

erutan commented Aug 10, 2010

it still dies running http://omega8.cc/dev/aegir-vanilla-install.sh.txt - and I made sure to install php-pear + Console_Table. for what's it worth /var/aegir/install.log wasn't present before the info: simple check

resolveip aegir.local gives me the correct 127.0.1.1 - so there's another command that works (i found that out by poking around the vanilla.sh.txt). i'll try playing with that in the initial install script.

@omega8cc
Copy link
Owner

[EDIT]
resolveip is a MySQL tool so it is not available when the installer runs all its steps before installing MariaDB and we need to rely on host command to check if your DNS setup is correct. I will see if we can do anything about it however the project main goal is to help with setup of live Aegir hosting systems.

Since you have all required libraries and tools installed, you can just run the vanilla Aegir installer. You need to download it and run manually:

cd; wget http://omega8.cc/dev/install.sh.txt

su -s /bin/bash aegir -c "bash install.sh.txt hq.aegir.local --http_service_type='nginx'"

This file is modified to download patched already Drush.

@erutan
Copy link
Author

erutan commented Aug 10, 2010

ok, I guess it can just be marked as not working for local installs (fully at least).

thanks for the help / exploration of the issue. :)

@omega8cc
Copy link
Owner

As far as I know, this installer works with local install in VM, you just need to use proper DNS setup on your VM and host machine, see: http://github.com/omega8cc/nginx-for-drupal/issues/closed#issue/7/comment/345947

@erutan
Copy link
Author

erutan commented Aug 19, 2010

yeah I meant local as in using a local dev setup without worrying about external servers / dns... a VM is a VM. :)

I take it you want this open for the education of users?

@anantagati
Copy link

I was using Barracuda installer on my desktop and it helped me to:

  • define:

_MY_OWNIP="127.0.0.1"

_MY_HOSTN="aegir.local"

_MY_FRONT="aegir.local"

and then I replaced lines like this:

_THISRDIP= host $_THISHOST | cut -d: -f2 | awk '{ print $4}'

to this:

_THISRDIP="$_MY_OWNIP"

it installed without any errors and Aegir works good.

Only problem is that it doesn't send emails, but it is not issue for me.

@erutan
Copy link
Author

erutan commented Aug 20, 2010

Interesting. I commented out some code earlier in the script (to pass the check) and Aegir failed but I was still getting e-mails from opticron about package updates (I think at this point I bridged the connection in my VM and used a real IP). I'll come back to this when I focus on my dev setup again!

@omega8cc
Copy link
Owner

I decided to keep open almost all issues for Barracuda installer, because some people can simply miss them, when the issue is closed since it's then a bit harder to find. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants